diff options
Diffstat (limited to 'Tests')
77 files changed, 567 insertions, 36 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index fdb1638..9467fae 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -48,3 +48,25 @@ endif() add_library(iface INTERFACE) add_library(Alias::Iface ALIAS iface) + +get_target_property(_notAlias1 foo ALIASED_TARGET) +if (NOT DEFINED _notAlias1) + message(SEND_ERROR "_notAlias1 is not defined") +endif() +if (_notAlias1) + message(SEND_ERROR "_notAlias1 is defined, but foo is not an ALIAS") +endif() +if (NOT _notAlias1 STREQUAL _notAlias1-NOTFOUND) + message(SEND_ERROR "_notAlias1 not defined to a -NOTFOUND variant") +endif() + +get_property(_notAlias2 TARGET foo PROPERTY ALIASED_TARGET) +if (NOT DEFINED _notAlias2) + message(SEND_ERROR "_notAlias2 is not defined") +endif() +if (_notAlias2) + message(SEND_ERROR "_notAlias2 is defined, but foo is not an ALIAS") +endif() +if (NOT _notAlias2 STREQUAL _notAlias2-NOTFOUND) + message(SEND_ERROR "_notAlias2 not defined to a -NOTFOUND variant") +endif() diff --git a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt index 1652cf6..995b32c 100644 --- a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt +++ b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt @@ -12,3 +12,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") "DO_GNU_TESTS" ) endif() + +add_compile_options(-rtti) +add_library(imp UNKNOWN IMPORTED) +get_target_property(_res imp COMPILE_OPTIONS) +if (_res) + message(SEND_ERROR "add_compile_options populated the COMPILE_OPTIONS target property") +endif() diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt index 900dbd0..14d40aa 100644 --- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt @@ -25,3 +25,10 @@ target_compile_definitions(consumer target_compile_definitions(consumer PRIVATE ) + +add_definitions(-DSOME_DEF) +add_library(imp UNKNOWN IMPORTED) +get_target_property(_res imp COMPILE_DEFINITIONS) +if (_res) + message(SEND_ERROR "add_definitions populated the COMPILE_DEFINITIONS target property") +endif() diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt index 8a564c7..661bbaa 100644 --- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt +++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt @@ -62,3 +62,10 @@ target_include_directories(consumer target_include_directories(consumer SYSTEM PRIVATE ) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_library(imp UNKNOWN IMPORTED) +get_target_property(_res imp INCLUDE_DIRECTORIES) +if (_res) + message(SEND_ERROR "include_directories populated the INCLUDE_DIRECTORIES target property") +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c992d1d..7969078 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2181,6 +2181,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestConfig/ScriptWithArgs.log" ) + ADD_TEST_MACRO(CMakeCommands.add_compile_options add_compile_options) ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) ADD_TEST_MACRO(CMakeCommands.target_include_directories target_include_directories) ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions) @@ -2232,6 +2233,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ADD_TEST_MACRO(CTestTestSerialInDepends ${CMAKE_CTEST_COMMAND} -j 4 --output-on-failure -C "\${CTestTest_CONFIG}") + ADD_TEST_MACRO(CTestTestMissingDependsExe ${CMAKE_CTEST_COMMAND} + --output-on-failure -C "\${CTestTest_CONFIG}") + set_tests_properties(CTestTestMissingDependsExe PROPERTIES + PASS_REGULAR_EXPRESSION "\\*\\*\\*Not Run" + ) + + ADD_TEST_MACRO(CTestTestSerialOrder ${CMAKE_CTEST_COMMAND} + --output-on-failure -C "\${CTestTest_CONFIG}") + if(NOT BORLAND) set(CTestLimitDashJ_CTEST_OPTIONS --force-new-ctest-process) add_test_macro(CTestLimitDashJ ${CMAKE_CTEST_COMMAND} -j 4 diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt index 0b06045..bc3322e 100644 --- a/Tests/CPackWiXGenerator/CMakeLists.txt +++ b/Tests/CPackWiXGenerator/CMakeLists.txt @@ -51,6 +51,8 @@ set(CPACK_PACKAGE_EXECUTABLES set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") + include(CPack) cpack_add_install_type(Full DISPLAY_NAME "Everything") diff --git a/Tests/CPackWiXGenerator/license.txt b/Tests/CPackWiXGenerator/license.txt new file mode 100644 index 0000000..7942783 --- /dev/null +++ b/Tests/CPackWiXGenerator/license.txt @@ -0,0 +1,9 @@ +hello world +merhaba dünya +ハローワールド +привет мир +مرحبا العالم +你好世界 + +4-Byte sequences: + Perch (Fish) 𩶘 Elevator 𨋢! diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in index 214bff8..ab39b88 100644 --- a/Tests/CTestTest/test.cmake.in +++ b/Tests/CTestTest/test.cmake.in @@ -6,7 +6,7 @@ # this is the cvs module name that should be checked out set (CTEST_MODULE_NAME SmallAndFast) -# these are the the name of the source and binary directory on disk. +# these are the name of the source and binary directory on disk. # They will be appended to DASHBOARD_ROOT set (CTEST_SOURCE_NAME SmallAndFast) set (CTEST_BINARY_NAME SmallAndFastBuild) diff --git a/Tests/CTestTestMissingDependsExe/CMakeLists.txt b/Tests/CTestTestMissingDependsExe/CMakeLists.txt new file mode 100644 index 0000000..9826da6 --- /dev/null +++ b/Tests/CTestTestMissingDependsExe/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.12) + +project(CTestTestMissingDependsExe) + +enable_testing() + +add_test(test1 ${CMAKE_COMMAND} -E echo test) +add_test(test2 non-existent-command) + +set_tests_properties(test1 PROPERTIES DEPENDS test2) diff --git a/Tests/CTestTestSerialOrder/CMakeLists.txt b/Tests/CTestTestSerialOrder/CMakeLists.txt new file mode 100644 index 0000000..69c11fc --- /dev/null +++ b/Tests/CTestTestSerialOrder/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.8.12) + +project(CTestTestSerialOrder) + +set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt") + +enable_testing() + +function(add_serial_order_test TEST_NAME) + add_test(NAME ${TEST_NAME} + COMMAND ${CMAKE_COMMAND} + "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}" + "-DTEST_NAME=${TEST_NAME}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake" + ) + + if(ARGC GREATER 1) + set_tests_properties(${TEST_NAME} PROPERTIES ${ARGN}) + endif() +endfunction() + +add_serial_order_test(initialization COST 1000) +add_serial_order_test(test1) +add_serial_order_test(test2) +add_serial_order_test(test3) +add_serial_order_test(test4 DEPENDS test5) + +add_serial_order_test(test5) +set_tests_properties(test5 PROPERTIES DEPENDS "test6;test7b;test7a") + +add_serial_order_test(test6 COST -2) +add_serial_order_test(test7a COST -1) +add_serial_order_test(test7b COST -1) +add_serial_order_test(test8 COST 10) +add_serial_order_test(test9 COST 20) +add_serial_order_test(test10 COST 0) +add_serial_order_test(test11) +add_serial_order_test(test12 COST 0) + +add_serial_order_test(verification COST -1000) diff --git a/Tests/CTestTestSerialOrder/test.cmake b/Tests/CTestTestSerialOrder/test.cmake new file mode 100644 index 0000000..8479cae --- /dev/null +++ b/Tests/CTestTestSerialOrder/test.cmake @@ -0,0 +1,31 @@ +list(APPEND EXPECTED_OUTPUT + initialization + test9 + test8 + test1 + test2 + test3 + test6 + test7a + test7b + test5 + test4 + test10 + test11 + test12 +) + + +if("${TEST_NAME}" STREQUAL "initialization") + file(WRITE ${TEST_OUTPUT_FILE} "${TEST_NAME}") + +elseif("${TEST_NAME}" STREQUAL "verification") + file(READ ${TEST_OUTPUT_FILE} ACTUAL_OUTPUT) + if(NOT "${ACTUAL_OUTPUT}" STREQUAL "${EXPECTED_OUTPUT}") + message(FATAL_ERROR "Actual test order [${ACTUAL_OUTPUT}] differs from expected test order [${EXPECTED_OUTPUT}]") + endif() + +else() + file(APPEND ${TEST_OUTPUT_FILE} ";${TEST_NAME}") + +endif() diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 5e64d2a..350b518 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -24,6 +24,8 @@ set_property(TARGET iface1 APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 + NUMBER_MIN_PROP3 + NUMBER_MIN_PROP4 ) set_property(TARGET iface1 APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX @@ -34,7 +36,7 @@ set_property(TARGET iface1 APPEND PROPERTY set(CMAKE_DEBUG_TARGET_PROPERTIES BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 STRING_PROP1 STRING_PROP2 STRING_PROP3 - NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 + NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MIN_PROP3 NUMBER_MIN_PROP4 NUMBER_MAX_PROP1 NUMBER_MAX_PROP2 ) @@ -44,6 +46,8 @@ set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1) set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200) +set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP3 0x10) +set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP4 0x10) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200) @@ -56,6 +60,8 @@ set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2) set_property(TARGET CompatibleInterface PROPERTY STRING_PROP3 prop3) set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP1 50) set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP2 250) +set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP3 0xa) +set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP4 0x1A) set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP1 50) set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP2 250) @@ -69,6 +75,8 @@ target_compile_definitions(CompatibleInterface $<$<STREQUAL:$<TARGET_PROPERTY:STRING_PROP3>,prop3>:STRING_PROP3> $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP1>,50>:NUMBER_MIN_PROP1=50> $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP2>,200>:NUMBER_MIN_PROP2=200> + $<$<EQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA> + $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP4>,0x10>:NUMBER_MIN_PROP4=0x10> $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP1>,100>:NUMBER_MAX_PROP1=100> $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP2>,250>:NUMBER_MAX_PROP2=250> ) diff --git a/Tests/CompatibleInterface/main.cpp b/Tests/CompatibleInterface/main.cpp index fa299e9..e23625a 100644 --- a/Tests/CompatibleInterface/main.cpp +++ b/Tests/CompatibleInterface/main.cpp @@ -33,7 +33,9 @@ enum { NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>), NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>), NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>), - NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>) + NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>), + NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>), + NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>) }; #include "iface2.h" diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index b713262..9d4793d 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -23,12 +23,10 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_ add_library(sharediface INTERFACE) target_link_libraries(sharediface INTERFACE sharedlib) -export(TARGETS sharediface sharedlib headeronly - NAMESPACE bld:: - FILE ../ExportInterfaceBuildTree.cmake +install(TARGETS headeronly sharediface + EXPORT expInterface ) - -install(TARGETS headeronly sharediface sharedlib +install(TARGETS sharedlib EXPORT expInterface RUNTIME DESTINATION bin LIBRARY DESTINATION lib NAMELINK_SKIP @@ -47,3 +45,8 @@ install(FILES ) install(EXPORT expInterface NAMESPACE exp:: DESTINATION lib/exp) + +export(EXPORT expInterface + NAMESPACE bld:: + FILE ../ExportInterfaceBuildTree.cmake +) diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 892f80f..3b85dc3 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -13,6 +13,7 @@ add_custom_target(check-part1 ALL -Dtest_1=$<1:content> -Dtest_1_with_comma=$<1:-Wl,--no-undefined> -Dconfig=$<CONFIGURATION> + -Dshort_config=$<CONFIG> -Dtest_and_0=$<AND:0> -Dtest_and_0_0=$<AND:0,0> -Dtest_and_0_1=$<AND:0,1> @@ -196,6 +197,29 @@ add_custom_target(check-part3 ALL -Dlower_case=$<LOWER_CASE:Mi,XeD> -Dupper_case=$<UPPER_CASE:MiX,eD> -Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4f,oo:+bar-$> + -Dequal1=$<EQUAL:1,2> + -Dequal2=$<EQUAL:1,1> + -Dequal3=$<EQUAL:0x1,1> + -Dequal4=$<EQUAL:0X1,2> + -Dequal5=$<EQUAL:0xA,0xa> + -Dequal6=$<EQUAL:0xA,10> + -Dequal7=$<EQUAL:0xA,012> + -Dequal8=$<EQUAL:10,012> + -Dequal9=$<EQUAL:10,010> + -Dequal10=$<EQUAL:10,0b1010> + -Dequal11=$<EQUAL:-10,-0xa> + -Dequal12=$<EQUAL:10,+0xa> + -Dequal13=$<EQUAL:+10,+0Xa> + -Dequal14=$<EQUAL:+10,0xa> + -Dequal15=$<EQUAL:-10,-0Xa> + -Dequal16=$<EQUAL:-10,-0b1010> + -Dequal17=$<EQUAL:-10,+0b1010> + -Dequal18=$<EQUAL:10,+0B1010> + -Dequal19=$<EQUAL:10,-0B1010> + -Dequal20=$<EQUAL:10,0B1010> + -Dequal21=$<EQUAL:10,+012> + -Dequal22=$<EQUAL:10,-012> + -Dequal23=$<EQUAL:-10,-012> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake index 9bef159..3207582 100644 --- a/Tests/GeneratorExpression/check-part1.cmake +++ b/Tests/GeneratorExpression/check-part1.cmake @@ -2,6 +2,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake) message(STATUS "config=[${config}]") +check(config "${short_config}") check(test_0 "") check(test_0_with_comma "") check(test_1 "content") diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 3361eeb..70ccfe1 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -37,3 +37,26 @@ endforeach() check(lower_case "mi,xed") check(upper_case "MIX,ED") check(make_c_identifier "_4f_oo__bar__") +check(equal1 "0") +check(equal2 "1") +check(equal3 "1") +check(equal4 "0") +check(equal5 "1") +check(equal6 "1") +check(equal7 "1") +check(equal8 "1") +check(equal9 "0") +check(equal10 "1") +check(equal11 "1") +check(equal12 "1") +check(equal13 "1") +check(equal14 "1") +check(equal15 "1") +check(equal16 "1") +check(equal17 "0") +check(equal18 "1") +check(equal19 "0") +check(equal20 "1") +check(equal21 "1") +check(equal22 "0") +check(equal23 "1") diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index 1f5c93b..abe9f74 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -25,6 +25,10 @@ add_library(imported_consumer imported_consumer.cpp) target_link_libraries(imported_consumer iface) target_compile_options(imported_consumer PRIVATE -Werror=unused-variable) +add_library(imported_consumer2 imported_consumer.cpp) +target_link_libraries(imported_consumer2 imported_consumer) +target_compile_options(imported_consumer2 PRIVATE -Werror=unused-variable) + macro(do_try_compile error_option) set(TC_ARGS IFACE_TRY_COMPILE_${error_option} diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index 8154ced..b396eb6 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -6,13 +6,15 @@ project(InterfaceLibrary) add_library(iface_nodepends INTERFACE) target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE) +add_subdirectory(headerdir) + add_executable(InterfaceLibrary definetestexe.cpp) -target_link_libraries(InterfaceLibrary iface_nodepends) +target_link_libraries(InterfaceLibrary iface_nodepends headeriface) add_subdirectory(libsdir) add_executable(sharedlibtestexe sharedlibtestexe.cpp) -target_link_libraries(sharedlibtestexe shared_iface) +target_link_libraries(sharedlibtestexe shared_iface imported::iface) add_library(broken EXCLUDE_FROM_ALL broken.cpp) diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp index decd37c..e7a10c1 100644 --- a/Tests/InterfaceLibrary/definetestexe.cpp +++ b/Tests/InterfaceLibrary/definetestexe.cpp @@ -3,6 +3,18 @@ #error Expected IFACE_DEFINE #endif +#include "iface_header.h" + +#ifndef IFACE_HEADER_SRCDIR +#error Expected IFACE_HEADER_SRCDIR +#endif + +#include "iface_header_builddir.h" + +#ifndef IFACE_HEADER_BUILDDIR +#error Expected IFACE_HEADER_BUILDDIR +#endif + int main(int,char**) { return 0; diff --git a/Tests/InterfaceLibrary/headerdir/CMakeLists.txt b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt new file mode 100644 index 0000000..98f521e --- /dev/null +++ b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) + +add_library(headeriface INTERFACE) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/iface_header_builddir.h" + "#define IFACE_HEADER_BUILDDIR\n" +) diff --git a/Tests/InterfaceLibrary/headerdir/iface_header.h b/Tests/InterfaceLibrary/headerdir/iface_header.h new file mode 100644 index 0000000..82dd157 --- /dev/null +++ b/Tests/InterfaceLibrary/headerdir/iface_header.h @@ -0,0 +1 @@ +#define IFACE_HEADER_SRCDIR diff --git a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt index 6999646..4e529df 100644 --- a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt +++ b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt @@ -24,3 +24,5 @@ target_compile_definitions(shareddependlib add_library(shared_iface INTERFACE) target_link_libraries(shared_iface INTERFACE sharedlib) + +add_library(imported::iface INTERFACE IMPORTED GLOBAL) diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt index b8d5a04..c60de84 100644 --- a/Tests/LinkDirectory/CMakeLists.txt +++ b/Tests/LinkDirectory/CMakeLists.txt @@ -11,13 +11,11 @@ endif() add_library(mylibA STATIC mylibA.c) set_property(TARGET mylibA PROPERTY ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/External/lib") -# get_property(mylibA TARGET mylibA PROPERTY LOCATION) # Build a library into our build tree relative to the subproject build tree. add_library(mylibB STATIC mylibB.c) set_property(TARGET mylibB PROPERTY ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/lib") -# get_property(mylibB TARGET mylibB PROPERTY LOCATION) # Create a custom target to drive the subproject build. include(ExternalProject) diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt index 5fc54f4..ade0a3c 100644 --- a/Tests/MacRuntimePath/A/CMakeLists.txt +++ b/Tests/MacRuntimePath/A/CMakeLists.txt @@ -10,13 +10,15 @@ add_library(shared2 SHARED shared.cpp shared.h) set_target_properties(shared2 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath") +cmake_policy(SET CMP0042 NEW) + # a framework library add_library(framework SHARED framework.cpp framework.h) -set_target_properties(framework PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) +set_target_properties(framework PROPERTIES FRAMEWORK 1) # another framework add_library(framework2 SHARED framework2.cpp framework2.h) -set_target_properties(framework2 PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) +set_target_properties(framework2 PROPERTIES FRAMEWORK 1) # executable to test a shared library dependency with install rpaths add_executable(test1 test1.cpp) diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 9dd5289..7b99395 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -47,7 +47,6 @@ add_custom_target(generate_moc_input COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}" COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" ) -# set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" PROPERTIES GENERATED TRUE) add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake index 57c3ed0..2e76ee0 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake @@ -1,5 +1,7 @@ enable_language(CXX) +cmake_policy(SET CMP0042 NEW) + add_library(foo SHARED empty_vs6_1.cpp) add_library(bar SHARED empty_vs6_2.cpp) target_link_libraries(bar foo) diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake index fe7e858..e3552b2 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake @@ -1,6 +1,8 @@ project(CMP0022-WARN) +cmake_policy(SET CMP0042 NEW) + add_library(foo SHARED empty_vs6_1.cpp) add_library(bar SHARED empty_vs6_2.cpp) add_library(bat SHARED empty_vs6_3.cpp) diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt b/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake new file mode 100644 index 0000000..778a444 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0042 NEW) + +add_library(foo SHARED empty.cpp) diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake b/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake new file mode 100644 index 0000000..1aede96 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0042 OLD) + +add_library(foo SHARED empty.cpp) diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt new file mode 100644 index 0000000..f3574a1 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\): + Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake + --help-policy CMP0042" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + MACOSX_RPATH is not specified for the following targets: + + foo + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake b/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake new file mode 100644 index 0000000..3fa32b1 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake @@ -0,0 +1,9 @@ + +add_library(foo SHARED empty.cpp) +add_library(foo-static STATIC empty.cpp) +add_library(foo2 SHARED empty.cpp) +set_target_properties(foo2 PROPERTIES MACOSX_RPATH 1) +add_library(foo3 SHARED empty.cpp) +set_target_properties(foo3 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@loader_path") +add_library(foo4 SHARED empty.cpp) +set_target_properties(foo4 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath") diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt new file mode 100644 index 0000000..11ea636 --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0042/RunCMakeTest.cmake b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake new file mode 100644 index 0000000..3b226d7 --- /dev/null +++ b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0042-OLD) +run_cmake(CMP0042-NEW) +run_cmake(CMP0042-WARN) diff --git a/Tests/RunCMake/CMP0042/empty.cpp b/Tests/RunCMake/CMP0042/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0042/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e091155..50c1f61 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -61,6 +61,9 @@ add_RunCMake_test(CMP0038) add_RunCMake_test(CMP0039) add_RunCMake_test(CMP0040) add_RunCMake_test(CMP0041) +if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) + add_RunCMake_test(CMP0042) +endif() add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake index 86bd5a0..03635e2 100644 --- a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake +++ b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake @@ -1,9 +1,6 @@ find_package(Qt4 REQUIRED) -set(QT_CORE_TARGET Qt4::QtCore) -set(QT_GUI_TARGET Qt4::QtGui) - set(CMAKE_AUTOUIC ON) set(CMAKE_DEBUG_TARGET_PROPERTIES AUTOUIC_OPTIONS) @@ -19,4 +16,4 @@ set_property(TARGET OtherI18n APPEND PROPERTY ) add_library(LibWidget empty.cpp) -target_link_libraries(LibWidget KI18n OtherI18n ${QT_GUI_TARGET}) +target_link_libraries(LibWidget KI18n OtherI18n Qt4::QtGui) diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt index 0044564..17b8a5c 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt @@ -25,6 +25,28 @@ CMake Debug Log: \* Target "CompatibleInterface" property not set. + CMake Debug Log: + Boolean compatibility of property "BOOL_PROP5" for target + "CompatibleInterface" \(result: "FALSE"\): + + \* Target "CompatibleInterface" property not set. + \* Target "iface1" property value "FALSE" \(Interface set\) ++ +CMake Debug Log: + Boolean compatibility of property "BOOL_PROP6" for target + "CompatibleInterface" \(result: "FALSE"\): + + \* Target "CompatibleInterface" property not set. + \* Target "iface1" property value "FALSE" \(Interface set\) + \* Target "iface2" property value "FALSE" \(Agree\) ++ +CMake Debug Log: + Boolean compatibility of property "BOOL_PROP7" for target + "CompatibleInterface" \(result: "FALSE"\): + + \* Target "CompatibleInterface" property is implied by use. + \* Target "iface1" property value "FALSE" \(Agree\) ++ +CMake Debug Log: String compatibility of property "STRING_PROP1" for target "CompatibleInterface" \(result: "prop1"\): @@ -45,6 +67,12 @@ CMake Debug Log: \* Target "CompatibleInterface" has property content "prop3" + CMake Debug Log: + String compatibility of property "STRING_PROP4" for target + "CompatibleInterface" \(result: "\(unset\)"\): + + \* Target "CompatibleInterface" property not set. ++ +CMake Debug Log: Numeric minimum compatibility of property "NUMBER_MIN_PROP1" for target "CompatibleInterface" \(result: "50"\): diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake index 3214d8e..0196611 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake @@ -13,12 +13,16 @@ set_property(TARGET iface1 APPEND PROPERTY BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 + BOOL_PROP5 + BOOL_PROP6 + BOOL_PROP7 ) set_property(TARGET iface1 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING STRING_PROP1 STRING_PROP2 STRING_PROP3 + STRING_PROP4 # Not set. ) set_property(TARGET iface1 APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN @@ -32,14 +36,17 @@ set_property(TARGET iface1 APPEND PROPERTY ) set(CMAKE_DEBUG_TARGET_PROPERTIES - BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 - STRING_PROP1 STRING_PROP2 STRING_PROP3 + BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6 BOOL_PROP7 + STRING_PROP1 STRING_PROP2 STRING_PROP3 STRING_PROP4 NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MAX_PROP1 NUMBER_MAX_PROP2 ) set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON) set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON) +set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 OFF) +set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP6 OFF) +set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP7 OFF) set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1) set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100) @@ -47,8 +54,15 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100) set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200) +add_library(iface2 INTERFACE) +set_property(TARGET iface2 PROPERTY INTERFACE_BOOL_PROP6 OFF) + +add_library(iface3 INTERFACE) + add_executable(CompatibleInterface empty.cpp) -target_link_libraries(CompatibleInterface iface1) +target_link_libraries(CompatibleInterface iface1 iface2 + $<$<BOOL:$<TARGET_PROPERTY:BOOL_PROP7>>:iface3> +) set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON) set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON) diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt new file mode 100644 index 0000000..723daec --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt @@ -0,0 +1,4 @@ +CMake Error: Property SOMEPROP on target "user" is +implied to be empty because it was used to determine the link libraries +already. The INTERFACE_SOMEPROP property on +dependency "foo" is in conflict. diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake new file mode 100644 index 0000000..a064d76 --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake @@ -0,0 +1,9 @@ + +add_library(foo UNKNOWN IMPORTED) +add_library(bar UNKNOWN IMPORTED) + +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN SOMEPROP) +set_property(TARGET foo PROPERTY INTERFACE_SOMEPROP 42) + +add_executable(user main.cpp) +target_link_libraries(user foo $<$<STREQUAL:$<TARGET_PROPERTY:SOMEPROP>,42>:bar>) diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt index 5a8f99d..900e3f8 100644 --- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt @@ -2,4 +2,5 @@ CMake Error in CMakeLists.txt: Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user". This is not allowed. A property may only require compatibility in a - boolean interpretation or a string interpretation, but not both. + boolean interpretation, a numeric minimum, a numeric maximum or a string + interpretation, but not a mixture. diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake index 711368a..4bae804 100644 --- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake @@ -1,9 +1,8 @@ add_library(foo UNKNOWN IMPORTED) -add_library(bar UNKNOWN IMPORTED) set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING) set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING) add_executable(user main.cpp) -target_link_libraries(user foo bar) +target_link_libraries(user foo) diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt new file mode 100644 index 0000000..2cfbae4 --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt @@ -0,0 +1,7 @@ +CMake Error in CMakeLists.txt: + Property "OTHER" appears in both the COMPATIBLE_INTERFACE_BOOL, + COMPATIBLE_INTERFACE_NUMBER_MIN and the COMPATIBLE_INTERFACE_STRING + property in the dependencies of target "user". This is not allowed. A + property may only require compatibility in a boolean interpretation, a + numeric minimum, a numeric maximum or a string interpretation, but not a + mixture. diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake new file mode 100644 index 0000000..164ffd9 --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake @@ -0,0 +1,9 @@ + +add_library(foo UNKNOWN IMPORTED) + +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL OTHER) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING OTHER) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN OTHER) + +add_executable(user main.cpp) +target_link_libraries(user foo) diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake index b87adc8..0b9729b 100644 --- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake @@ -7,8 +7,10 @@ run_cmake(InterfaceBool-builtin-prop) run_cmake(InterfaceString-mismatch-depends) run_cmake(InterfaceString-mismatch-depend-self) run_cmake(InterfaceString-mismatched-use) +run_cmake(InterfaceNumber-mismatched-use) run_cmake(InterfaceString-builtin-prop) run_cmake(InterfaceString-Bool-Conflict) +run_cmake(InterfaceString-Bool-Min-Conflict) run_cmake(DebugProperties) if (QT_QMAKE_EXECUTABLE}) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 1cfbf40..964ea4d 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -1,15 +1,6 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: - \$<CONFIG> - - \$<CONFIG> expression requires exactly one parameter. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): - Error evaluating generator expression: - \$<CONFIG:.> Expression syntax not recognized. @@ -21,7 +12,7 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): \$<CONFIG:Foo,Bar> - \$<CONFIG> expression requires exactly one parameter. + \$<CONFIG> expression requires one or zero parameters. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index c27ea5f..5c22aaa 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,5 +1,4 @@ add_custom_target(check ALL COMMAND check - $<CONFIG> $<CONFIG:.> $<CONFIG:Foo,Bar> $<CONFIG:Foo-Bar> diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 6533b75..5a80872 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -11,3 +11,8 @@ \* CMP0020 \* CMP0021 \* CMP0022 + \* CMP0041 + \* CMP0042 + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/AppendExport-result.txt b/Tests/RunCMake/export/AppendExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/AppendExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/AppendExport-stderr.txt b/Tests/RunCMake/export/AppendExport-stderr.txt new file mode 100644 index 0000000..6e385d4 --- /dev/null +++ b/Tests/RunCMake/export/AppendExport-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at AppendExport.cmake:8 \(export\): + export EXPORT signature does not recognise the APPEND option. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/AppendExport.cmake b/Tests/RunCMake/export/AppendExport.cmake new file mode 100644 index 0000000..f36010b --- /dev/null +++ b/Tests/RunCMake/export/AppendExport.cmake @@ -0,0 +1,8 @@ +add_library(foo empty.cpp) +export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +export(EXPORT fooExport APPEND FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") diff --git a/Tests/RunCMake/export/NoExportSet-result.txt b/Tests/RunCMake/export/NoExportSet-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/NoExportSet-stderr.txt b/Tests/RunCMake/export/NoExportSet-stderr.txt new file mode 100644 index 0000000..9d27805 --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoExportSet.cmake:2 \(export\): + export Export set "fooExport" not found. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/NoExportSet.cmake b/Tests/RunCMake/export/NoExportSet.cmake new file mode 100644 index 0000000..72390e8 --- /dev/null +++ b/Tests/RunCMake/export/NoExportSet.cmake @@ -0,0 +1,2 @@ + +export(EXPORT fooExport) diff --git a/Tests/RunCMake/export/OldIface-result.txt b/Tests/RunCMake/export/OldIface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/OldIface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/OldIface-stderr.txt b/Tests/RunCMake/export/OldIface-stderr.txt new file mode 100644 index 0000000..afb4ae3 --- /dev/null +++ b/Tests/RunCMake/export/OldIface-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at OldIface.cmake:8 \(export\): + export EXPORT signature does not recognise the + EXPORT_LINK_INTERFACE_LIBRARIES option. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/OldIface.cmake b/Tests/RunCMake/export/OldIface.cmake new file mode 100644 index 0000000..5fb8e25 --- /dev/null +++ b/Tests/RunCMake/export/OldIface.cmake @@ -0,0 +1,10 @@ +add_library(foo empty.cpp) +export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake") +install(TARGETS foo EXPORT fooExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +export(EXPORT fooExport + EXPORT_LINK_INTERFACE_LIBRARIES +) diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index b8d3f27..4b04f18 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -1,3 +1,6 @@ include(RunCMake) run_cmake(TargetNotFound) +run_cmake(AppendExport) +run_cmake(OldIface) +run_cmake(NoExportSet) diff --git a/Tests/RunCMake/include/ExportExportInclude-result.txt b/Tests/RunCMake/include/ExportExportInclude-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include/ExportExportInclude-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include/ExportExportInclude-stderr.txt b/Tests/RunCMake/include/ExportExportInclude-stderr.txt new file mode 100644 index 0000000..70d013c --- /dev/null +++ b/Tests/RunCMake/include/ExportExportInclude-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at ExportExportInclude.cmake:6 \(include\): + include could not find load file: + + .*/Tests/RunCMake/include/ExportExportInclude-build/theTargets.cmake +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/include/ExportExportInclude.cmake b/Tests/RunCMake/include/ExportExportInclude.cmake new file mode 100644 index 0000000..14e5d91 --- /dev/null +++ b/Tests/RunCMake/include/ExportExportInclude.cmake @@ -0,0 +1,6 @@ + +add_library(iface INTERFACE) +install(TARGETS iface EXPORT ifaceExport) + +export(EXPORT ifaceExport FILE "${CMAKE_CURRENT_BINARY_DIR}/theTargets.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/theTargets.cmake") diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake index 7fc9a12..bea7d5c 100644 --- a/Tests/RunCMake/include/RunCMakeTest.cmake +++ b/Tests/RunCMake/include/RunCMakeTest.cmake @@ -4,3 +4,4 @@ run_cmake(EmptyString) run_cmake(EmptyStringOptional) run_cmake(CMP0024-WARN) run_cmake(CMP0024-NEW) +run_cmake(ExportExportInclude) diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake index 0d00b71..9ca9a77 100644 --- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake @@ -4,4 +4,6 @@ run_cmake(invalid_name) run_cmake(target_commands) run_cmake(no_shared_libs) run_cmake(whitelist) +run_cmake(invalid_signature) run_cmake(genex_link) +run_cmake(add_dependencies) diff --git a/Tests/RunCMake/interface_library/add_dependencies-result.txt b/Tests/RunCMake/interface_library/add_dependencies-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/add_dependencies-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/add_dependencies-stderr.txt b/Tests/RunCMake/interface_library/add_dependencies-stderr.txt new file mode 100644 index 0000000..c550b68 --- /dev/null +++ b/Tests/RunCMake/interface_library/add_dependencies-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at add_dependencies.cmake:4 \(add_dependencies\): + add_dependencies Cannot add target-level dependencies to INTERFACE library + target "iface". + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/add_dependencies.cmake b/Tests/RunCMake/interface_library/add_dependencies.cmake new file mode 100644 index 0000000..12cdfb4 --- /dev/null +++ b/Tests/RunCMake/interface_library/add_dependencies.cmake @@ -0,0 +1,4 @@ + +add_library(foo empty.cpp) +add_library(iface INTERFACE) +add_dependencies(iface foo) diff --git a/Tests/RunCMake/interface_library/invalid_signature-result.txt b/Tests/RunCMake/interface_library/invalid_signature-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/invalid_signature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt new file mode 100644 index 0000000..701586a --- /dev/null +++ b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt @@ -0,0 +1,89 @@ +CMake Error at invalid_signature.cmake:2 \(add_library\): + add_library INTERFACE library requires no source arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:3 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:4 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:5 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:6 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:7 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:8 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:9 \(add_library\): + add_library INTERFACE library specified with conflicting STATIC type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:10 \(add_library\): + add_library INTERFACE library specified with conflicting SHARED type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:11 \(add_library\): + add_library INTERFACE library specified with conflicting MODULE type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:12 \(add_library\): + add_library INTERFACE library specified with conflicting OBJECT type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:13 \(add_library\): + add_library INTERFACE library specified with conflicting UNKNOWN type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:14 \(add_library\): + add_library INTERFACE library specified with conflicting ALIAS type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:15 \(add_library\): + add_library INTERFACE library specified with conflicting ALIAS type. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:16 \(add_library\): + add_library INTERFACE library specified with conflicting/multiple types. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:17 \(add_library\): + add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:18 \(add_library\): + add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at invalid_signature.cmake:20 \(add_library\): + add_library INTERFACE library requires no source arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/invalid_signature.cmake b/Tests/RunCMake/interface_library/invalid_signature.cmake new file mode 100644 index 0000000..67e3267 --- /dev/null +++ b/Tests/RunCMake/interface_library/invalid_signature.cmake @@ -0,0 +1,20 @@ + +add_library(iface1 INTERFACE empty.cpp) +add_library(iface3 STATIC INTERFACE) +add_library(iface4 STATIC INTERFACE empty.cpp) +add_library(iface5 SHARED INTERFACE) +add_library(iface6 MODULE INTERFACE) +add_library(iface7 OBJECT INTERFACE) +add_library(iface8 UNKNOWN INTERFACE) +add_library(iface9 INTERFACE STATIC) +add_library(iface10 INTERFACE SHARED) +add_library(iface11 INTERFACE MODULE) +add_library(iface12 INTERFACE OBJECT) +add_library(iface13 INTERFACE UNKNOWN) +add_library(iface14 INTERFACE ALIAS) +add_library(iface15 ALIAS INTERFACE) +add_library(iface16 INTERFACE INTERFACE) +add_library(iface17 INTERFACE EXCLUDE_FROM_ALL) +add_library(iface18 EXCLUDE_FROM_ALL INTERFACE) +add_library(iface19 GLOBAL INTERFACE) +add_library(iface20 INTERFACE GLOBAL) |