mirror of
https://github.com/reactos/CMake.git
synced 2024-12-16 08:07:29 +00:00
Autogen: Tests: Disable some tests on non ASCII build paths
This commit is contained in:
parent
38e3fc4bdd
commit
7f68ad6612
@ -20,6 +20,16 @@ if (WIN32)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Qt4 moc does not support utf8 paths in _parameter files generated by
|
||||||
|
# qt4_wrap_cpp and qt4_generate_moc
|
||||||
|
# https://bugreports.qt.io/browse/QTBUG-35480
|
||||||
|
# Do a simple check if there is are non ASCII character in the build path
|
||||||
|
string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
if(NON_ASCII_BDIR)
|
||||||
|
message(WARNING "Build path contains non ASCII characters. Skipping Qt4 test.")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
qt4_generate_moc(main_gen_test.cpp
|
qt4_generate_moc(main_gen_test.cpp
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc"
|
"${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc"
|
||||||
TARGET Qt4GenerateMacroTest
|
TARGET Qt4GenerateMacroTest
|
||||||
|
@ -46,6 +46,20 @@ endif()
|
|||||||
|
|
||||||
get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES)
|
get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES)
|
||||||
|
|
||||||
|
# Qt4 moc does not support utf8 paths in _parameter files generated by
|
||||||
|
# qtx_wrap_cpp
|
||||||
|
# https://bugreports.qt.io/browse/QTBUG-35480
|
||||||
|
# Do a simple check if there is are non ASCII character in the build path
|
||||||
|
string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
if((NOT NON_ASCII_BDIR) OR (NOT QT_TEST_VERSION STREQUAL 4))
|
||||||
|
set(ALLOW_WRAP_CPP TRUE)
|
||||||
|
endif()
|
||||||
|
# On windows qtx_wrap_cpp also fails in Qt5 when used on a path that
|
||||||
|
# contains non ASCII characters
|
||||||
|
if(NON_ASCII_BDIR AND WIN32)
|
||||||
|
set(ALLOW_WRAP_CPP FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# -- Test
|
# -- Test
|
||||||
# RCC only
|
# RCC only
|
||||||
add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
|
add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
|
||||||
@ -60,10 +74,12 @@ target_link_libraries(rccEmpty ${QT_QTCORE_TARGET})
|
|||||||
|
|
||||||
# -- Test
|
# -- Test
|
||||||
# UIC only
|
# UIC only
|
||||||
qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
|
if(ALLOW_WRAP_CPP)
|
||||||
add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
|
qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
|
||||||
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
|
||||||
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
||||||
|
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
# -- Test
|
# -- Test
|
||||||
# Add not_generated_file.qrc to the source list to get the file-level
|
# Add not_generated_file.qrc to the source list to get the file-level
|
||||||
@ -209,25 +225,27 @@ endif()
|
|||||||
|
|
||||||
# -- Test
|
# -- Test
|
||||||
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
|
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
|
||||||
qtx_wrap_cpp(skipMocWrapMoc
|
if(ALLOW_WRAP_CPP)
|
||||||
|
qtx_wrap_cpp(skipMocWrapMoc
|
||||||
skipSource/qItemA.hpp
|
skipSource/qItemA.hpp
|
||||||
skipSource/qItemB.hpp)
|
skipSource/qItemB.hpp)
|
||||||
set(skipMocSources
|
set(skipMocSources
|
||||||
skipMoc.cpp
|
skipMoc.cpp
|
||||||
skipSource/qItemA.cpp
|
skipSource/qItemA.cpp
|
||||||
skipSource/qItemB.cpp
|
skipSource/qItemB.cpp
|
||||||
skipSource/qItemC.cpp)
|
skipSource/qItemC.cpp)
|
||||||
set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
|
set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
|
||||||
set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
|
set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
|
||||||
# AUTOMOC enabled only
|
# AUTOMOC enabled only
|
||||||
add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
|
add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
|
||||||
set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
|
set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
|
||||||
target_link_libraries(skipMocA ${QT_LIBRARIES})
|
target_link_libraries(skipMocA ${QT_LIBRARIES})
|
||||||
# AUTOMOC and AUTOUIC enabled
|
# AUTOMOC and AUTOUIC enabled
|
||||||
add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
|
add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
|
||||||
set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
|
set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
|
||||||
set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
|
set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
|
||||||
target_link_libraries(skipMocB ${QT_LIBRARIES})
|
target_link_libraries(skipMocB ${QT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
# -- Test
|
# -- Test
|
||||||
# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
|
# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
|
||||||
|
Loading…
Reference in New Issue
Block a user