diff options
Diffstat (limited to 'Tests')
203 files changed, 2039 insertions, 376 deletions
diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt index 555a08f..5096a58 100644 --- a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt @@ -1,45 +1,65 @@ cmake_minimum_required(VERSION 3.0) +cmake_policy(SET CMP0057 NEW) project(target_compile_features) -if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp" - "int main(int,char**) { return 0; }\n" - ) - add_executable(target_compile_features "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp") - return() -endif() - set(CMAKE_VERBOSE_MAKEFILE ON) -if (CMAKE_C_COMPILE_FEATURES) - add_executable(target_compile_features main.c) - target_compile_features(target_compile_features +if (c_restrict IN_LIST CMAKE_C_COMPILE_FEATURES) + add_executable(c_target_compile_features_specific main.c) + target_compile_features(c_target_compile_features_specific PRIVATE c_restrict ) - add_library(lib_restrict lib_restrict.c) - target_compile_features(lib_restrict + add_library(c_lib_restrict_specific lib_restrict.c) + target_compile_features(c_lib_restrict_specific PUBLIC c_restrict ) - add_executable(restrict_user restrict_user.c) - target_link_libraries(restrict_user lib_restrict) + add_executable(c_restrict_user_specific restrict_user.c) + target_link_libraries(c_restrict_user_specific c_lib_restrict_specific) endif() -if (CMAKE_CXX_COMPILE_FEATURES AND ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;") - if (CMAKE_C_COMPILE_FEATURES) - set(target_suffix _cxx) - endif() - add_executable(target_compile_features${target_suffix} main.cpp) - target_compile_features(target_compile_features${target_suffix} +if (c_std_99 IN_LIST CMAKE_C_COMPILE_FEATURES) + add_executable(c_target_compile_features_meta main.c) + target_compile_features(c_target_compile_features_meta + PRIVATE c_std_99 + ) + + add_library(c_lib_restrict_meta lib_restrict.c) + target_compile_features(c_lib_restrict_meta + PUBLIC c_std_99 + ) + + add_executable(c_restrict_user_meta restrict_user.c) + target_link_libraries(c_restrict_user_meta c_lib_restrict_meta) +endif() + +if (cxx_auto_type IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(cxx_target_compile_features_specific main.cpp) + target_compile_features(cxx_target_compile_features_specific PRIVATE cxx_auto_type ) - add_library(lib_auto_type lib_auto_type.cpp) - target_compile_features(lib_auto_type + add_library(cxx_lib_auto_type_specific lib_auto_type.cpp) + target_compile_features(cxx_lib_auto_type_specific PUBLIC cxx_auto_type ) - add_executable(lib_user lib_user.cpp) - target_link_libraries(lib_user lib_auto_type) + add_executable(cxx_lib_user_specific lib_user.cpp) + target_link_libraries(cxx_lib_user_specific cxx_lib_auto_type_specific) +endif() + +if (cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(cxx_target_compile_features_meta main.cpp) + target_compile_features(cxx_target_compile_features_meta + PRIVATE cxx_std_11 + ) + + add_library(cxx_lib_auto_type_meta lib_auto_type.cpp) + target_compile_features(cxx_lib_auto_type_meta + PUBLIC cxx_std_11 + ) + + add_executable(cxx_lib_user_meta lib_user.cpp) + target_link_libraries(cxx_lib_user_meta cxx_lib_auto_type_meta) endif() diff --git a/Tests/CMakeCommands/target_compile_features/dummy.cpp b/Tests/CMakeCommands/target_compile_features/dummy.cpp deleted file mode 100644 index e9ad257..0000000 --- a/Tests/CMakeCommands/target_compile_features/dummy.cpp +++ /dev/null @@ -1,5 +0,0 @@ - -int main(int, char**) -{ - return 0; -} diff --git a/Tests/CMakeCommands/target_link_libraries/empty.cpp b/Tests/CMakeCommands/target_link_libraries/empty.cpp index ab32cf6..a6ecef8 100644 --- a/Tests/CMakeCommands/target_link_libraries/empty.cpp +++ b/Tests/CMakeCommands/target_link_libraries/empty.cpp @@ -1 +1,3 @@ -// No content +// Solaris needs non-empty content so ensure +// we have at least one symbol +int Solaris_requires_a_symbol_here = 0; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2f53cfc9..34418c5 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,6 +1,9 @@ # a macro for tests that have a simple format where the name matches the # directory and project -macro(ADD_TEST_MACRO NAME COMMAND) +macro(ADD_TEST_MACRO NAME) + if(${ARGC} GREATER 1) + set(_test_command --test-command ${ARGN}) + endif() string(REPLACE "." "/" dir "${NAME}") string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") add_test(NAME "${NAME}" COMMAND "${CMAKE_CTEST_COMMAND}" @@ -13,7 +16,8 @@ macro(ADD_TEST_MACRO NAME COMMAND) ${${NAME}_CTEST_OPTIONS} --build-options ${build_options} ${${NAME}_BUILD_OPTIONS} - --test-command ${COMMAND} ${ARGN}) + ${_test_command}) + unset(_test_command) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") endmacro() @@ -271,7 +275,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) ADD_TEST_MACRO(CompileFeatures CompileFeatures) - ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features) + ADD_TEST_MACRO(CMakeCommands.target_compile_features) if(CMake_TEST_RESOURCES) ADD_TEST_MACRO(VSResource VSResource) @@ -327,6 +331,7 @@ if(BUILD_TESTING) if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])") ADD_TEST_MACRO(CSharpOnly CSharpOnly) + ADD_TEST_MACRO(CSharpLinkToCxx CSharpLinkToCxx) endif() ADD_TEST_MACRO(COnly COnly) @@ -1385,12 +1390,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindBZip2) endif() + if(CMake_TEST_FindDoxygen) + add_subdirectory(FindDoxygen) + endif() + if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() if(CMake_TEST_FindGTest) add_subdirectory(FindGTest) + add_subdirectory(GoogleTest) endif() if(CMake_TEST_FindICU) @@ -1437,6 +1447,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindPNG) endif() + if(CMake_TEST_FindProtobuf) + add_subdirectory(FindProtobuf) + endif() + if(CMake_TEST_FindTIFF) add_subdirectory(FindTIFF) endif() @@ -1719,6 +1733,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5 AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>) set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx) ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V) endif() @@ -2067,7 +2082,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]") foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm) get_filename_component(r "${reg_${reg}}" ABSOLUTE) - if(IS_DIRECTORY "${r}") + if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry") set(${reg} 1) else() set(${reg} 0) @@ -3100,6 +3115,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif () endif () + if(CMake_TEST_EXTERNAL_CMAKE) + set(CMAKE_SKIP_BOOTSTRAP_TEST 1) + endif() if("${CMAKE_GENERATOR}" MATCHES Xcode) set(CMAKE_SKIP_BOOTSTRAP_TEST 1) endif() diff --git a/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in b/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in index 3294a2f..a3c2b05 100644 --- a/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in +++ b/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in @@ -22,6 +22,25 @@ try_and_print(TOTAL_VIRTUAL_MEMORY) try_and_print(AVAILABLE_VIRTUAL_MEMORY) try_and_print(TOTAL_PHYSICAL_MEMORY) try_and_print(AVAILABLE_PHYSICAL_MEMORY) +try_and_print(IS_64BIT) +try_and_print(HAS_FPU) +try_and_print(HAS_MMX) +try_and_print(HAS_MMX_PLUS) +try_and_print(HAS_SSE) +try_and_print(HAS_SSE2) +try_and_print(HAS_SSE_FP) +try_and_print(HAS_SSE_MMX) +try_and_print(HAS_AMD_3DNOW) +try_and_print(HAS_AMD_3DNOW_PLUS) +try_and_print(HAS_IA64) +try_and_print(HAS_SERIAL_NUMBER) +try_and_print(PROCESSOR_SERIAL_NUMBER) +try_and_print(PROCESSOR_NAME) +try_and_print(PROCESSOR_DESCRIPTION) +try_and_print(OS_NAME) +try_and_print(OS_RELEASE) +try_and_print(OS_VERSION) +try_and_print(OS_PLATFORM) include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index 58e2bf9..d7d881e 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -7,19 +7,19 @@ include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) # gcc dummy.c -v set(linux64_gcc_text " /usr/lib/gcc/x86_64-linux-gnu/4.3.3/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccEO9iux.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crtn.o") -set(linux64_gcc_libs "c") +set(linux64_gcc_libs "gcc;gcc_s;c;gcc;gcc_s") set(linux64_gcc_dirs "/usr/lib/gcc/x86_64-linux-gnu/4.3.3;/usr/lib;/lib;/usr/lib/x86_64-linux-gnu") list(APPEND platforms linux64_gcc) # g++ dummy.cxx -v set(linux64_g++_text " /usr/lib/gcc/x86_64-linux-gnu/4.3.3/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccalRBlq.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crtn.o") -set(linux64_g++_libs "stdc++;m;c") +set(linux64_g++_libs "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") set(linux64_g++_dirs "/usr/lib/gcc/x86_64-linux-gnu/4.3.3;/usr/lib;/lib;/usr/lib/x86_64-linux-gnu") list(APPEND platforms linux64_g++) # f95 dummy.f -v set(linux64_f95_text " /usr/lib/gcc/x86_64-linux-gnu/4.3.3/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccAVcN7N.o -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crtn.o") -set(linux64_f95_libs "gfortranbegin;gfortran;m;c") +set(linux64_f95_libs "gfortranbegin;gfortran;m;gcc_s;gcc;c;gcc_s;gcc") set(linux64_f95_dirs "/usr/lib/gcc/x86_64-linux-gnu/4.3.3;/usr/lib;/lib;/usr/lib/x86_64-linux-gnu") list(APPEND platforms linux64_f95) @@ -43,43 +43,43 @@ list(APPEND platforms linux64_sunf90) # icc dummy.c -v set(linux64_icc_text "ld /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o --eh-frame-hdr -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /tmp/iccBP8OfN.o -L/opt/compiler/intel/compiler/11.0/lib/intel64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.. -L/lib64 -L/lib -L/usr/lib64 -L/usr/lib -Bstatic -limf -lsvml -Bdynamic -lm -Bstatic -lipgo -ldecimal -lirc -Bdynamic -lgcc_s -lgcc -Bstatic -lirc -Bdynamic -lc -lgcc_s -lgcc -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o") -set(linux64_icc_libs "imf;svml;m;ipgo;decimal;irc;irc;c;irc_s;dl;c") +set(linux64_icc_libs "imf;svml;m;ipgo;decimal;irc;gcc_s;gcc;irc;c;gcc_s;gcc;irc_s;dl;c") set(linux64_icc_dirs "/opt/compiler/intel/compiler/11.0/lib/intel64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib") list(APPEND platforms linux64_icc) # icxx dummy.cxx -v set(linux64_icxx_text "ld /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o --eh-frame-hdr -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /tmp/icpc270GoT.o -L/opt/compiler/intel/compiler/11.0/lib/intel64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.. -L/lib64 -L/lib -L/usr/lib64 -L/usr/lib -Bstatic -limf -lsvml -Bdynamic -lm -Bstatic -lipgo -ldecimal -Bdynamic -lstdc++ -Bstatic -lirc -Bdynamic -lgcc_s -lgcc -Bstatic -lirc -Bdynamic -lc -lgcc_s -lgcc -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o") -set(linux64_icxx_libs "imf;svml;m;ipgo;decimal;stdc++;irc;irc;c;irc_s;dl;c") +set(linux64_icxx_libs "imf;svml;m;ipgo;decimal;stdc++;irc;gcc_s;gcc;irc;c;gcc_s;gcc;irc_s;dl;c") set(linux64_icxx_dirs "/opt/compiler/intel/compiler/11.0/lib/intel64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib") list(APPEND platforms linux64_icxx) # ifort dummy.f -v set(linux64_ifort_text "ld --eh-frame-hdr -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out -L/opt/compiler/intel/compiler/11.0/lib/intel64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.. -L/lib64 -L/lib -L/usr/lib64 -L/usr/lib /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o /opt/compiler/intel/compiler/11.0/lib/intel64/for_main.o dum.cxx -Bstatic -lifport -lifcore -limf -lsvml -Bdynamic -lm -Bstatic -lipgo -lirc -Bdynamic -lpthread -lc -lgcc_s -lgcc -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o") -set(linux64_ifort_libs "ifport;ifcore;imf;svml;m;ipgo;irc;pthread;c;irc_s;dl;c") +set(linux64_ifort_libs "ifport;ifcore;imf;svml;m;ipgo;irc;pthread;c;gcc_s;gcc;irc_s;dl;c") set(linux64_ifort_dirs "/opt/compiler/intel/compiler/11.0/lib/intel64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib") list(APPEND platforms linux64_ifort) # pgcc dummy.c -v set(linux64_pgcc_text "/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o /opt/compiler/pgi/linux86-64/8.0-3/lib/trace_init.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /opt/compiler/pgi/linux86-64/8.0-3/lib/pgi.ld -L/opt/compiler/pgi/linux86-64/8.0-3/lib -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 /tmp/pgcc7OscXa5ur7Zk.o -rpath /opt/compiler/pgi/linux86-64/8.0-3/lib -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/crtn.o") -set(linux64_pgcc_libs "nspgc;pgc;m;c") +set(linux64_pgcc_libs "nspgc;pgc;m;gcc;c;gcc") set(linux64_pgcc_dirs "/opt/compiler/pgi/linux86-64/8.0-3/lib;/usr/lib64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2") list(APPEND platforms linux64_pgcc) # pgCC dummy.cxx -v set(linux64_pgCC_text "/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o /opt/compiler/pgi/linux86-64/8.0-3/lib/trace_init.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /opt/compiler/pgi/linux86-64/8.0-3/lib/pgi.ld -L/opt/compiler/pgi/linux86-64/8.0-3/lib -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 /tmp/pgCCFhjcDt1fs1Ki.o -rpath /opt/compiler/pgi/linux86-64/8.0-3/lib -lstd -lC -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/crtn.o") -set(linux64_pgCC_libs "std;C;nspgc;pgc;m;c") +set(linux64_pgCC_libs "std;C;nspgc;pgc;m;gcc;c;gcc") set(linux64_pgCC_dirs "/opt/compiler/pgi/linux86-64/8.0-3/lib;/usr/lib64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2") list(APPEND platforms linux64_pgCC) # pgf90 dummy.f -v set(linux64_pgf90_text "/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o /opt/compiler/pgi/linux86-64/8.0-3/lib/trace_init.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o /opt/compiler/pgi/linux86-64/8.0-3/lib/f90main.o -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /opt/compiler/pgi/linux86-64/8.0-3/lib/pgi.ld -L/opt/compiler/pgi/linux86-64/8.0-3/lib -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 /tmp/pgf90QOIc_eB9xY5h.o -rpath /opt/compiler/pgi/linux86-64/8.0-3/lib -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lpthread -lm -lgcc -lc -lgcc /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/crtn.o") -set(linux64_pgf90_libs "pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;nspgc;pgc;rt;pthread;m;c") +set(linux64_pgf90_libs "pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;nspgc;pgc;rt;pthread;m;gcc;c;gcc") set(linux64_pgf90_dirs "/opt/compiler/pgi/linux86-64/8.0-3/lib;/usr/lib64;/usr/lib64/gcc/x86_64-suse-linux/4.1.2") list(APPEND platforms linux64_pgf90) # nagfor dummy.f -Wl,-v set(linux64_nagfor_text " /usr/libexec/gcc/x86_64-redhat-linux/4.4.5/collect2 --no-add-needed --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../.. /usr/local/NAG/lib/f90_init.o /usr/local/NAG/lib/quickfit.o dummy.o -rpath /usr/local/NAG/lib /usr/local/NAG/lib/libf53.so /usr/local/NAG/lib/libf53.a -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.4.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../lib64/crtn.o") -set(linux64_nagfor_libs "/usr/local/NAG/lib/f90_init.o;/usr/local/NAG/lib/quickfit.o;/usr/local/NAG/lib/libf53.a;m;c") +set(linux64_nagfor_libs "/usr/local/NAG/lib/f90_init.o;/usr/local/NAG/lib/quickfit.o;/usr/local/NAG/lib/libf53.a;m;gcc;gcc_s;c;gcc;gcc_s") set(linux64_nagfor_dirs "/usr/lib/gcc/x86_64-redhat-linux/4.4.5;/usr/lib64;/lib64;/usr/lib") set(linux64_nagfor_obj_regex "^/usr/local/NAG/lib") list(APPEND platforms linux64_nagfor) @@ -87,7 +87,7 @@ list(APPEND platforms linux64_nagfor) # absoft dummy.f -X -v set(linux64_absoft_text "collect2 version 4.4.5 (x86-64 Linux/ELF) /usr/bin/ld --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbegin.o -L/opt/absoft11.1/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../.. /tmp/E3Bii1/dummy.o -v -laf90math -lafio -lamisc -labsoftmain -laf77math -lm -lmv -lpthread -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o") -set(linux64_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv;pthread;c") +set(linux64_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv;pthread;gcc;gcc_s;c;gcc;gcc_s") set(linux64_absoft_dirs "/opt/absoft11.1/lib64;/usr/lib/gcc/x86_64-linux-gnu/4.4.5;/usr/lib;/lib") list(APPEND platforms linux64_absoft) @@ -108,13 +108,13 @@ list(APPEND platforms linux64_test2) # -specs=redhat-hardened-ld set(linux64_test3_text "COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' '-v' '-O2' '-g' '-pipe' '-Wall' '-Werror=format-security' '-fexceptions' '-fstack-protector-strong' '--param' 'ssp-buffer-size=4' '-grecord-gcc-switches' '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' '-m64' '-mtune=generic' '-I' '/usr/lib64/gfortran/modules' '-o' 'a.out' '-rdynamic' '-shared-libgcc' '-march=x86-64' '-pie' /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNzxFD8.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z now -pie -o a.out /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../.. -z relro dummy.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crtn.o") -set(linux64_test3_libs "gfortran;m;quadmath;m;c") +set(linux64_test3_libs "gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc") set(linux64_test3_dirs "/usr/lib/gcc/x86_64-redhat-linux/5.1.1;/usr/lib64;/lib64;/usr/lib") list(APPEND platforms linux64_test3) # clang -fsanitize=memory set(linux64_clang_sanitize_memory_text [[ "/usr/bin/ld" --hash-style=both --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../.. -L/usr/lib/llvm-3.8/bin/../lib -L/lib -L/usr/lib -whole-archive /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/lib/linux/libclang_rt.msan-x86_64.a -no-whole-archive --dynamic-list=/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/lib/linux/libclang_rt.msan-x86_64.a.syms /tmp/dummy-27898d.o --no-as-needed -lpthread -lrt -lm -ldl -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crtn.o]]) -set(linux64_clang_sanitize_memory_libs "pthread;rt;m;dl;c") +set(linux64_clang_sanitize_memory_libs "pthread;rt;m;dl;gcc;gcc_s;c;gcc;gcc_s") set(linux64_clang_sanitize_memory_dirs "/usr/lib/gcc/x86_64-linux-gnu/5.4.0;/usr/lib/x86_64-linux-gnu;/lib/x86_64-linux-gnu;/lib64;/usr/lib;/usr/lib/llvm-3.8/lib;/lib") list(APPEND platforms linux64_clang_sanitize_memory) @@ -137,14 +137,14 @@ Library search paths: Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/") -set(mac_i686_gcc_Wlv_libs "") +set(mac_i686_gcc_Wlv_libs "gcc") set(mac_i686_gcc_Wlv_dirs "/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib;/usr/local/lib") set(mac_i686_gcc_Wlv_fwks "/Library/Frameworks;/System/Library/Frameworks") list(APPEND platforms mac_i686_gcc_Wlv) # gcc -arch i686 dummy.c -v set(mac_i686_gcc_text " /usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2 -dynamic -arch i386 -macosx_version_min 10.6.0 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. /var/tmp//ccnhXAGL.o -lSystem -lgcc -lSystem") -set(mac_i686_gcc_libs "") +set(mac_i686_gcc_libs "gcc") set(mac_i686_gcc_dirs "/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_i686_gcc) @@ -164,14 +164,14 @@ Library search paths: Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/") -set(mac_i686_g++_Wlv_libs "stdc++") +set(mac_i686_g++_Wlv_libs "stdc++;gcc") set(mac_i686_g++_Wlv_dirs "/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib;/usr/local/lib") set(mac_i686_g++_Wlv_fwks "/Library/Frameworks;/System/Library/Frameworks") list(APPEND platforms mac_i686_g++_Wlv) # g++ -arch i686 dummy.cxx -v set(mac_i686_g++_text " /usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2 -dynamic -arch i386 -macosx_version_min 10.6.0 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. /var/tmp//ccEXXICh.o -lstdc++ -lSystem -lgcc -lSystem") -set(mac_i686_g++_libs "stdc++") +set(mac_i686_g++_libs "stdc++;gcc") set(mac_i686_g++_dirs "/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_i686_g++) @@ -188,14 +188,14 @@ Library search paths: Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/") -set(mac_i686_gfortran_Wlv_libs "gfortranbegin;gfortran") +set(mac_i686_gfortran_Wlv_libs "gfortranbegin;gfortran;gcc_s.10.5;gcc") set(mac_i686_gfortran_Wlv_dirs "/usr/local/lib/gcc/i386-apple-darwin9.7.0/4.4.1;/usr/local/lib;/usr/lib") set(mac_i686_gfortran_Wlv_fwks "/Library/Frameworks;/System/Library/Frameworks") list(APPEND platforms mac_i686_gfortran_Wlv) # gfortran dummy.f -v set(mac_i686_gfortran_text " /usr/libexec/gcc/i386-apple-darwin9.7.0/4.4.1/collect2 -dynamic -arch i386 -macosx_version_min 10.6.0 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/usr/lib/gcc/i386-apple-darwin9.7.0/4.4.1 -L/usr/lib/gcc -L/usr/lib/gcc/i386-apple-darwin9.7.0/4.4.1/../../.. /var/tmp//ccgqbX5P.o -lgfortranbegin -lgfortran -lgcc_s.10.5 -lgcc -lSystem") -set(mac_i686_gfortran_libs "gfortranbegin;gfortran") +set(mac_i686_gfortran_libs "gfortranbegin;gfortran;gcc_s.10.5;gcc") set(mac_i686_gfortran_dirs "/usr/lib/gcc/i386-apple-darwin9.7.0/4.4.1;/usr/lib/gcc;/usr/lib") list(APPEND platforms mac_i686_gfortran) @@ -215,14 +215,14 @@ Library search paths: Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/") -set(mac_ppc_gcc_Wlv_libs "") +set(mac_ppc_gcc_Wlv_libs "gcc") set(mac_ppc_gcc_Wlv_dirs "/usr/lib/powerpc-apple-darwin10/4.2.1;/usr/lib/gcc/powerpc-apple-darwin10/4.2.1;/usr/lib;/usr/local/lib") set(mac_ppc_gcc_Wlv_fwks "/Library/Frameworks;/System/Library/Frameworks") list(APPEND platforms mac_ppc_gcc_Wlv) # gcc -arch ppc dummy.c -v set(mac_ppc_gcc_text " /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/collect2 -dynamic -arch ppc -macosx_version_min 10.6.0 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/usr/lib/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../.. /var/tmp//ccdcolsP.o -lgcc -lSystemStubs -lSystem") -set(mac_ppc_gcc_libs "") +set(mac_ppc_gcc_libs "gcc") set(mac_ppc_gcc_dirs "/usr/lib/powerpc-apple-darwin10/4.2.1;/usr/lib/gcc/powerpc-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_ppc_gcc) @@ -242,14 +242,14 @@ Library search paths: Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/") -set(mac_ppc_g++_Wlv_libs "stdc++") +set(mac_ppc_g++_Wlv_libs "stdc++;gcc") set(mac_ppc_g++_Wlv_dirs "/usr/lib/powerpc-apple-darwin10/4.2.1;/usr/lib/gcc/powerpc-apple-darwin10/4.2.1;/usr/lib;/usr/local/lib") set(mac_ppc_g++_Wlv_fwks "/Library/Frameworks;/System/Library/Frameworks") list(APPEND platforms mac_ppc_g++_Wlv) # g++ -arch ppc dummy.cxx -v set(mac_ppc_g++_text " /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/collect2 -dynamic -arch ppc -macosx_version_min 10.6.0 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/usr/lib/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../../powerpc-apple-darwin10/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/../../.. /var/tmp//ccbjB6Lj.o -lstdc++ -lgcc -lSystemStubs -lSystem") -set(mac_ppc_g++_libs "stdc++") +set(mac_ppc_g++_libs "stdc++;gcc") set(mac_ppc_g++_dirs "/usr/lib/powerpc-apple-darwin10/4.2.1;/usr/lib/gcc/powerpc-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_ppc_g++) @@ -257,7 +257,7 @@ list(APPEND platforms mac_ppc_g++) set(mac_absoft_text "collect2 version 4.2.1 (Apple Inc. build 5664) (i686 Darwin) /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld -dynamic -arch i386 -macosx_version_min 10.6.6 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o -L/Applications/Absoft11.1/lib -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. /var/folders/04/04+Djjm8GZWBmuEdp2Gsw++++TM/-Tmp-//bTAoJc/dummy.o -v -Y 10 -laf90math -lafio -lamisc -labsoftmain -laf77math -lm -lmv -lSystem -lgcc -lSystem ") -set(mac_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv") +set(mac_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv;gcc") set(mac_absoft_dirs "/Applications/Absoft11.1/lib;/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_absoft) @@ -485,13 +485,13 @@ list(APPEND platforms irix64_f90_64) # gcc dummy.c -v set(cygwin_gcc_text " /usr/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe -Bdynamic --dll-search-prefix=cyg /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../crt0.o -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. /home/user/AppData/Local/Temp/cczg1Arh.o -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc") -set(cygwin_gcc_libs "cygwin;user32;kernel32;advapi32;shell32") +set(cygwin_gcc_libs "gcc;cygwin;user32;kernel32;advapi32;shell32;gcc") set(cygwin_gcc_dirs "/usr/lib/gcc/i686-pc-cygwin/3.4.4;/usr/lib") list(APPEND platforms cygwin_gcc) # g++ dummy.cxx -v set(cygwin_g++_text " /usr/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe -Bdynamic --dll-search-prefix=cyg /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../crt0.o -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. /home/user/AppData/Local/Temp/ccsvcDO6.o -lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc") -set(cygwin_g++_libs "stdc++;cygwin;user32;kernel32;advapi32;shell32") +set(cygwin_g++_libs "stdc++;gcc;cygwin;user32;kernel32;advapi32;shell32;gcc") set(cygwin_g++_dirs "/usr/lib/gcc/i686-pc-cygwin/3.4.4;/usr/lib") list(APPEND platforms cygwin_g++) @@ -499,7 +499,7 @@ list(APPEND platforms cygwin_g++) set(cygwin_gfortran_text "Configured with: ... LD=/opt/gcc-tools/bin/ld.exe /usr/lib/gcc/i686-pc-cygwin/4.3.2/collect2.exe -Bdynamic --dll-search-prefix=cyg -u ___register_frame_info -u ___deregister_frame_info /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../crt0.o /usr/lib/gcc/i686-pc-cygwin/4.3.2/crtbegin.o -L/usr/lib/gcc/i686-pc-cygwin/4.3.2 -L/usr/lib/gcc/i686-pc-cygwin/4.3.2 -L/usr/lib/gcc/i686-pc-cygwin/4.3.2/../../.. /home/user/AppData/Local/Temp/ccqRWKWg.o -lgfortranbegin -lgfortran -lgcc_s -lgcc_s -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc_s -lgcc_s -lgcc /usr/lib/gcc/i686-pc-cygwin/4.3.2/crtend.o ") -set(cygwin_gfortran_libs "gfortranbegin;gfortran;cygwin;user32;kernel32;advapi32;shell32") +set(cygwin_gfortran_libs "gfortranbegin;gfortran;gcc_s;gcc_s;gcc;cygwin;user32;kernel32;advapi32;shell32;gcc_s;gcc_s;gcc") set(cygwin_gfortran_dirs "/usr/lib/gcc/i686-pc-cygwin/4.3.2;/usr/lib") list(APPEND platforms cygwin_gfortran) @@ -508,19 +508,19 @@ list(APPEND platforms cygwin_gfortran) # gcc dummy.c -v set(msys_gcc_text " C:/some-mingw/bin/../libexec/gcc/mingw32/3.4.5/collect2.exe -Bdynamic /some-mingw/lib/crt2.o C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5 -LC:/some-mingw/bin/../lib/gcc -L/some-mingw/lib -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/../../.. C:/home/user/AppData/Local/Temp/cckQmvRt.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtend.o") -set(msys_gcc_libs "mingw32;moldname;mingwex;msvcrt;user32;kernel32;advapi32;shell32;mingw32;moldname;mingwex;msvcrt") +set(msys_gcc_libs "mingw32;gcc;moldname;mingwex;user32;kernel32;advapi32;shell32;mingw32;gcc;moldname;mingwex") set(msys_gcc_dirs "C:/some-mingw/lib/gcc/mingw32/3.4.5;C:/some-mingw/lib/gcc;/some-mingw/lib;C:/some-mingw/lib") list(APPEND platforms msys_gcc) # g++ dummy.cxx -v set(msys_g++_text " C:/some-mingw/bin/../libexec/gcc/mingw32/3.4.5/collect2.exe -Bdynamic /some-mingw/lib/crt2.o C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5 -LC:/some-mingw/bin/../lib/gcc -L/some-mingw/lib -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/../../.. C:/home/user/AppData/Local/Temp/cci5hYPk.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtend.o") -set(msys_g++_libs "stdc++;mingw32;moldname;mingwex;msvcrt;user32;kernel32;advapi32;shell32;mingw32;moldname;mingwex;msvcrt") +set(msys_g++_libs "stdc++;mingw32;gcc;moldname;mingwex;user32;kernel32;advapi32;shell32;mingw32;gcc;moldname;mingwex") set(msys_g++_dirs "C:/some-mingw/lib/gcc/mingw32/3.4.5;C:/some-mingw/lib/gcc;/some-mingw/lib;C:/some-mingw/lib") list(APPEND platforms msys_g++) # g77 dummy.f -v set(msys_g77_text " C:/some-mingw/bin/../libexec/gcc/mingw32/3.4.5/collect2.exe -Bdynamic /some-mingw/lib/crt2.o C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5 -LC:/some-mingw/bin/../lib/gcc -L/some-mingw/lib -LC:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/../../.. C:/home/user/AppData/Local/Temp/ccabRxQ1.o -lfrtbegin -lg2c -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt C:/some-mingw/bin/../lib/gcc/mingw32/3.4.5/crtend.o") -set(msys_g77_libs "frtbegin;g2c;mingw32;moldname;mingwex;msvcrt;user32;kernel32;advapi32;shell32;mingw32;moldname;mingwex;msvcrt") +set(msys_g77_libs "frtbegin;g2c;mingw32;gcc;moldname;mingwex;user32;kernel32;advapi32;shell32;mingw32;gcc;moldname;mingwex") set(msys_g77_dirs "C:/some-mingw/lib/gcc/mingw32/3.4.5;C:/some-mingw/lib/gcc;/some-mingw/lib;C:/some-mingw/lib") list(APPEND platforms msys_g77) @@ -532,11 +532,56 @@ set(nvcc_msvc_libs "cudadevrt.lib;cudart_static.lib") set(nvcc_msvc_dirs "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64") list(APPEND platforms nvcc_msvc) + +#----------------------------------------------------------------------------- +# PGI on Windows + +# Due to the different behavior of separate_arguments on non-Windows platforms, +# the following tests can only be performed on Windows +if(CMAKE_HOST_WIN32) + +# pgf95 dummy.f90 -v +set(windows_pgf95_text [[Writing to file C:\temp\pgf9510ipeUbTwN2V4pn.lnk +X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib\pgimainmx.obj C:\Program Files\PGICE/win64/17.4/lib\f90main.obj -incremental:no -debug -merge:__nv_module_id=.data -merge:.nvFatBinSegment=.data "-libpath:X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64" -libpath:X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib C:\temp\pgf959hxeUbfMYOLjUz.obj -out:dummy.exe -pdb:./dummy.pdb /DYNAMICBASE:NO -defaultlib:libpgmp -defaultlib:pg -defaultlib:libpgf90rtl -defaultlib:libpgf90 -defaultlib:libpgf90_rpm1 -defaultlib:libpgf902 -defaultlib:libpgf90rtl -defaultlib:libpgftnrtl -nodefaultlib:msvcrt -defaultlib:libvcruntime -defaultlib:libucrt -defaultlib:libcmt -defaultlib:libpgc14 -defaultlib:libnspgc -defaultlib:legacy_stdio_definitions -defaultlib:oldnames + +"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64\link.exe" /NOLOGO @C:\temp\pgf9510ipeUbTwN2V4pn.lnk]]) +set(windows_pgf95_startfile "pgimain[mx][xpt]+[.]obj") +set(windows_pgf95_libs "libpgmp;pg;libpgf90rtl;libpgf90;libpgf90_rpm1;libpgf902;libpgf90rtl;libpgftnrtl;libpgc14;libnspgc;legacy_stdio_definitions;oldnames") +set(windows_pgf95_dirs "X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64;X:/NOT-PROGRAM-FILES/PGICE/win64/17.4/lib") +list(APPEND platforms windows_pgf95) + +# pgf77 dummy.f77 -v +set(windows_pgf77_text [[Writing to file C:\temp\pgf776eC42buYRoCNJk.lnk +X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib\pgimainmx.obj C:\Program Files\PGICE/win64/17.4/lib\pgfmain.obj -incremental:no -debug -merge:__nv_module_id=.data -merge:.nvFatBinSegment=.data "-libpath:X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64" -libpath:X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib C:\temp\pgf775d842b0tH8AkdP.obj -out:dummy.exe -pdb:./dummy.pdb /DYNAMICBASE:NO -defaultlib:libpgmp -defaultlib:libpgftnrtl -nodefaultlib:msvcrt -defaultlib:libvcruntime -defaultlib:libucrt -defaultlib:libcmt -defaultlib:libpgc14 -defaultlib:libnspgc -defaultlib:legacy_stdio_definitions -defaultlib:oldnames + +"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64\link.exe" /NOLOGO @C:\temp\pgf776eC42buYRoCNJk.lnk]]) +set(windows_pgf77_startfile "pgimain[mx][xpt]+[.]obj") +set(windows_pgf77_libs "libpgmp;libpgftnrtl;libpgc14;libnspgc;legacy_stdio_definitions;oldnames") +set(windows_pgf77_dirs "X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64;X:/NOT-PROGRAM-FILES/PGICE/win64/17.4/lib") +list(APPEND platforms windows_pgf77) + +# pgcc dummy.c -v +set(windows_pgcc_text [[Writing to file C:\temp\pgcc6esqW26_ZNKyL.lnk +X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib\pgimainmx.obj -incremental:no -debug -merge:__nv_module_id=.data -merge:.nvFatBinSegment=.data "-libpath:X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64" "-libpath:X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64" -libpath:X:\NOT-PROGRAM-FILES\PGICE/win64/17.4/lib C:\temp\pgcc5dcqWgQXeXPWd.obj -out:dummy.exe -pdb:./dummy.pdb /DYNAMICBASE:NO -defaultlib:libpgmp -nodefaultlib:msvcrt -defaultlib:libvcruntime -defaultlib:libucrt -defaultlib:libcmt -defaultlib:libpgc14 -defaultlib:libnspgc -defaultlib:legacy_stdio_definitions -defaultlib:oldnames + +"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64\link.exe" /NOLOGO @C:\temp\pgcc6esqW26_ZNKyL.lnk]]) +set(windows_pgcc_startfile "pgimain[mx][xpt]+[.]obj") +set(windows_pgcc_libs "libpgmp;libpgc14;libnspgc;legacy_stdio_definitions;oldnames") +set(windows_pgcc_dirs "X:/NOT-PROGRAM-FILES-86/Microsoft Visual Studio 14.0/VC/Lib/AMD64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/ucrt/x64;X:/NOT-PROGRAM-FILES-86/Windows Kits/10/Lib/10.0.15063.0/um/x64;X:/NOT-PROGRAM-FILES/PGICE/win64/17.4/lib") +list(APPEND platforms windows_pgcc) + +endif() + #----------------------------------------------------------------------------- # Test parsing for all above examples. set(CMAKE_LINKER "not-a-linker[]().*+^$?") foreach(p IN LISTS platforms) + if(DEFINED ${p}_startfile) + set(CMAKE_LINK_STARTFILE "${${p}_startfile}") + else() + unset(CMAKE_LINK_STARTFILE) + endif() cmake_parse_implicit_link_info("${${p}_text}" libs dirs fwks log "${${p}_obj_regex}") foreach(v libs dirs fwks) diff --git a/Tests/CSharpLinkToCxx/CMakeLists.txt b/Tests/CSharpLinkToCxx/CMakeLists.txt new file mode 100644 index 0000000..c4269e0 --- /dev/null +++ b/Tests/CSharpLinkToCxx/CMakeLists.txt @@ -0,0 +1,17 @@ +# test if CSharp application correctly links +# to managed C++ binary +cmake_minimum_required(VERSION 3.9) +project (CSharpLinkToCxx CXX CSharp) + +# we have to change the default flags for the +# managed C++ project to build +string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) + +add_library(CLIApp SHARED cli.hpp cli.cpp) + +target_compile_options(CLIApp PRIVATE "/clr") + +add_executable(CSharpLinkToCxx csharp.cs) + +target_link_libraries(CSharpLinkToCxx CLIApp) diff --git a/Tests/CSharpLinkToCxx/cli.cpp b/Tests/CSharpLinkToCxx/cli.cpp new file mode 100644 index 0000000..97ac724 --- /dev/null +++ b/Tests/CSharpLinkToCxx/cli.cpp @@ -0,0 +1,10 @@ +#include "cli.hpp" + +using namespace System; + +namespace CLIApp { +void MyCli::testMyCli() +{ + Console::WriteLine("#message from CLIApp"); +} +} diff --git a/Tests/CSharpLinkToCxx/cli.hpp b/Tests/CSharpLinkToCxx/cli.hpp new file mode 100644 index 0000000..a8c116d --- /dev/null +++ b/Tests/CSharpLinkToCxx/cli.hpp @@ -0,0 +1,10 @@ +#pragma once + +namespace CLIApp { +public +ref class MyCli +{ +public: + void testMyCli(); +}; +} diff --git a/Tests/CSharpLinkToCxx/csharp.cs b/Tests/CSharpLinkToCxx/csharp.cs new file mode 100644 index 0000000..35c5cc3 --- /dev/null +++ b/Tests/CSharpLinkToCxx/csharp.cs @@ -0,0 +1,16 @@ +using System; +using CLIApp; + +namespace CSharpLinkToCxx +{ + internal class CSharpLinkToCxx + { + public static void Main(string[] args) + { + Console.WriteLine("#message from CSharpLinkToCxx"); + + var app = new MyCli(); + app.testMyCli(); + } + } +} diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 2a307d0..4a5558d 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,10 +1,11 @@ cmake_minimum_required(VERSION 3.1) +cmake_policy(SET CMP0057 NEW) project(CompileFeatures) macro(run_test feature lang) - if (";${CMAKE_${lang}_COMPILE_FEATURES};" MATCHES ${feature}) + if (${feature} IN_LIST CMAKE_${lang}_COMPILE_FEATURES) add_library(test_${feature} OBJECT ${feature}) set_property(TARGET test_${feature} PROPERTY COMPILE_FEATURES "${feature}" @@ -15,12 +16,13 @@ macro(run_test feature lang) endmacro() get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) -list(REMOVE_ITEM c_features c_std_90 c_std_99 c_std_11) +list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]") foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) -list(REMOVE_ITEM cxx_features cxx_std_98 cxx_std_11 cxx_std_14 cxx_std_17) +list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -171,12 +173,20 @@ if (CMAKE_C_COMPILER_ID STREQUAL "Intel") endif() endif() +if (CMAKE_C_COMPILE_FEATURES) + set(C_expected_features ${CMAKE_C_COMPILE_FEATURES}) + list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]") +endif() +if (CMAKE_CXX_COMPILE_FEATURES) + set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES}) + list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") +endif () set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) set(CXX_standard_flag 14) foreach(lang CXX C) - if (CMAKE_${lang}_COMPILE_FEATURES) + if (${lang}_expected_features) foreach(feature ${${lang}_non_features}) message("Testing feature : ${feature}") try_compile(${feature}_works @@ -198,7 +208,7 @@ foreach(lang CXX C) endif() endforeach() -if (CMAKE_C_COMPILE_FEATURES) +if (C_expected_features) if (CMAKE_C_STANDARD_DEFAULT) string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) if (std_flag_idx EQUAL -1) @@ -239,6 +249,16 @@ if (CMAKE_C_COMPILE_FEATURES) EXPECT_C_STATIC_ASSERT=0 ) endif() + elseif (CMAKE_C_COMPILER_ID STREQUAL "SunPro") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.13) + list(APPEND expected_defs + EXPECT_C_STATIC_ASSERT=1 + ) + else() + list(APPEND expected_defs + EXPECT_C_STATIC_ASSERT=0 + ) + endif() endif() list(APPEND expected_defs @@ -270,7 +290,8 @@ if (CMAKE_CXX_COMPILE_FEATURES) endif () # always add a target "CompileFeatures" -if (NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;") +if ((NOT CXX_expected_features) OR + (NOT cxx_auto_type IN_LIST CXX_expected_features)) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n" ) diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c index 0e67095..4debd94 100644 --- a/Tests/CompileFeatures/default_dialect.c +++ b/Tests/CompileFeatures/default_dialect.c @@ -11,7 +11,8 @@ #if !DEFAULT_C90 #error Buildsystem error #endif -#if defined(__STDC_VERSION__) +#if defined(__STDC_VERSION__) && \ + !(defined(__SUNPRO_C) && __STDC_VERSION__ == 199409L) #error Unexpected __STDC_VERSION__ definition #endif #endif diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt index 450ef48..a7137e3 100644 --- a/Tests/Cuda/Complex/CMakeLists.txt +++ b/Tests/Cuda/Complex/CMakeLists.txt @@ -42,7 +42,6 @@ add_executable(CudaComplex main.cpp) target_link_libraries(CudaComplex PUBLIC CudaComplexMixedLib) if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaComplex PRIVATE -Wl,-rpath,/usr/local/cuda/lib) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaComplex PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/Cuda/ObjectLibrary/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/CMakeLists.txt index 1d93be7..276dc92 100644 --- a/Tests/Cuda/ObjectLibrary/CMakeLists.txt +++ b/Tests/Cuda/ObjectLibrary/CMakeLists.txt @@ -10,8 +10,8 @@ add_library(CudaMixedObjectLib OBJECT static.cu static.cpp) add_executable(CudaObjectLibrary main.cpp $<TARGET_OBJECTS:CudaMixedObjectLib>) + if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaObjectLibrary PRIVATE -Wl,-rpath,/usr/local/cuda/lib) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaObjectLibrary PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt index 1f25ab4..831ce12 100644 --- a/Tests/Cuda/WithC/CMakeLists.txt +++ b/Tests/Cuda/WithC/CMakeLists.txt @@ -6,7 +6,6 @@ string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") add_executable(CudaWithC main.c cuda.cu) if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaWithC PRIVATE -Wl,-rpath,/usr/local/cuda/lib) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaWithC PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt index 10249c6..65d5243 100644 --- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt +++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt @@ -67,9 +67,8 @@ target_compile_definitions(CudaOnlyExportPTX PRIVATE "CONFIG_TYPE=gen_$<LOWER_CASE:$<CONFIG>>") if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaOnlyExportPTX PRIVATE -Wl,-rpath,/usr/local/cuda/lib) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaOnlyExportPTX PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() #Verify that we can install object targets properly diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt index b96bb98..8d6551b 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt @@ -46,7 +46,6 @@ add_executable(CudaOnlyResolveDeviceSymbols main.cu) target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE CUDAResolveDeviceLib) if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE -Wl,-rpath,/usr/local/cuda/lib) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaOnlyResolveDeviceSymbols PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 0a2542a..b946e3f 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -15,6 +15,10 @@ set(CMAKE_CUDA_STANDARD 11) add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu) +if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") + target_compile_options(CUDASeparateLibA PRIVATE -Xcompiler=-bigobj) +endif() + #Having file4/file5 in a shared library causes serious problems #with the nvcc linker and it will generate bad entries that will #cause a segv when trying to run the executable @@ -39,8 +43,7 @@ if (CMAKE_GENERATOR MATCHES "^Visual Studio") PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() -if (APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - target_link_libraries(CudaOnlySeparateCompilation PRIVATE -Wl,-rpath,/usr/local/cuda/lib) +if(APPLE) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaOnlySeparateCompilation PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index 38f2a44..0bc4e5c 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(CudaOnlyWithDefs ${main}) target_compile_options(CudaOnlyWithDefs PRIVATE + -Xcompiler=-DHOST_DEFINE $<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>> ) @@ -36,8 +37,7 @@ target_compile_definitions(CudaOnlyWithDefs $<$<CONFIG:RELEASE>:$<BUILD_INTERFACE:${release_compile_defs}>> ) -#we need to add an rpath for the cuda library so that everything -#loads properly on the mac -if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - set_target_properties(CudaOnlyWithDefs PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}") +if(APPLE) + # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime. + set_property(TARGET CudaOnlyWithDefs PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) endif() diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu index 80ed3a5..d2eff3f 100644 --- a/Tests/CudaOnly/WithDefs/main.notcu +++ b/Tests/CudaOnly/WithDefs/main.notcu @@ -2,6 +2,10 @@ #include <cuda_runtime.h> #include <iostream> +#ifndef HOST_DEFINE +#error "HOST_DEFINE not defined!" +#endif + #ifndef PACKED_DEFINE #error "PACKED_DEFINE not defined!" #endif diff --git a/Tests/CustomCommandByproducts/ninja-check.cmake b/Tests/CustomCommandByproducts/ninja-check.cmake index 2fc3cc2..a7beb3d 100644 --- a/Tests/CustomCommandByproducts/ninja-check.cmake +++ b/Tests/CustomCommandByproducts/ninja-check.cmake @@ -4,7 +4,7 @@ if("${build_ninja}" MATCHES [====[ # Tell Ninja that they may appear as side effects of build rules # otherwise ordered by order-only dependencies. -((build [^:]*: phony [^\n]* +((build [^:]*: phony[^\n]* )*)# ========]====]) set(phony "${CMAKE_MATCH_1}") if(NOT phony) diff --git a/Tests/ExportImport/Export/testLibNoSONAME.c b/Tests/ExportImport/Export/testLibNoSONAME.c index 30acc83..4d98562 100644 --- a/Tests/ExportImport/Export/testLibNoSONAME.c +++ b/Tests/ExportImport/Export/testLibNoSONAME.c @@ -4,7 +4,7 @@ #define testLibNoSONAME_EXPORT #endif -testLibNoSONAME_EXPORT int testLibNoSONAME(void) +testLibNoSONAME_EXPORT int testLibNoSoName(void) { return 0; } diff --git a/Tests/FindDoxygen/CMakeLists.txt b/Tests/FindDoxygen/CMakeLists.txt new file mode 100644 index 0000000..daceaa3 --- /dev/null +++ b/Tests/FindDoxygen/CMakeLists.txt @@ -0,0 +1,20 @@ +add_test(NAME FindDoxygen.SimpleTest COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDoxygen/SimpleTest" + "${CMake_BINARY_DIR}/Tests/FindDoxygen/SimpleTest" + --build-target allDocTargets + ${build_generator_args} + --build-options ${build_options} +) + +if(CMake_TEST_FindDoxygen_Dot) + add_test(NAME FindDoxygen.DotComponentTest COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDoxygen/DotComponentTestTest" + "${CMake_BINARY_DIR}/Tests/FindDoxygen/DotComponentTestTest" + ${build_generator_args} + --build-options ${build_options} + ) +endif() diff --git a/Tests/FindDoxygen/DotComponentTestTest/CMakeLists.txt b/Tests/FindDoxygen/DotComponentTestTest/CMakeLists.txt new file mode 100644 index 0000000..586f0ff --- /dev/null +++ b/Tests/FindDoxygen/DotComponentTestTest/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) +project(TestFindDoxygenDot VERSION 1.0 LANGUAGES NONE) + +# Testing a new signature w/ components +find_package(Doxygen REQUIRED COMPONENTS dot) + +# No backwards compatibility expected when component form is used +if(TARGET Doxygen::doxygen) + if(DOXYGEN) + message(FATAL_ERROR "DOXYGEN unexpectedly defined with component form") + endif() +else() + message(FATAL_ERROR "Import target Doxygen::doxygen not defined") +endif() + +if(NOT TARGET Doxygen::dot) + message(FATAL_ERROR "Import target Doxygen::dot not defined") +endif() diff --git a/Tests/FindDoxygen/SimpleTest/CMakeLists.txt b/Tests/FindDoxygen/SimpleTest/CMakeLists.txt new file mode 100644 index 0000000..332cecc --- /dev/null +++ b/Tests/FindDoxygen/SimpleTest/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 3.8) +project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE) + +# Testing backward compatible signature +find_package(Doxygen REQUIRED) + +if(TARGET Doxygen::doxygen) + # Check backward compatibility + if(NOT DOXYGEN_EXECUTABLE) + message(FATAL_ERROR "Backward compatibility broken: DOXYGEN_EXECUTABLE not set") + endif() + if(NOT DOXYGEN) + message(FATAL_ERROR "Backward compatibility broken: DOXYGEN not set") + endif() + # Check presence of expected generated files + foreach(file CMakeDoxyfile.in CMakeDoxygenDefaults.cmake) + if(NOT EXISTS "${PROJECT_BINARY_DIR}/${file}") + message(FATAL_ERROR "Missing generated file: ${file}") + endif() + endforeach() +else() + message(FATAL_ERROR "Import target Doxygen::doxygen not defined") +endif() + +doxygen_add_docs(docsNoArgs) +if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsNoArgs") + message(FATAL_ERROR "Missing generated file: Doxyfile.docsNoArgs") +endif() +if(NOT TARGET docsNoArgs) + message(FATAL_ERROR "Target docsNoArgs not created") +endif() + +configure_file(spaces_in_name.cpp.in "spaces in name.cpp" COPYONLY) +doxygen_add_docs(docsWithArgs + "${CMAKE_CURRENT_BINARY_DIR}/spaces in name.cpp" + main.cpp +) +if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithArgs") + message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithArgs") +endif() +if(NOT TARGET docsWithArgs) + message(FATAL_ERROR "Target docsWithArgs not created") +endif() +# Note that CMake inserts at least one entry into SOURCES when a COMMAND or +# DEPENDS option is given to add_custom_target(), so rather than looking for an +# exact match, we only verify that the files we expect to be there are present +get_target_property(srcList docsWithArgs SOURCES) +set(expectedList + "${CMAKE_CURRENT_BINARY_DIR}/spaces in name.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" +) +foreach(f IN LISTS expectedList) + if(NOT f IN_LIST srcList) + message(FATAL_ERROR "SOURCES missing file: ${f}") + endif() +endforeach() + +add_custom_target(allDocTargets) +add_dependencies(allDocTargets docsNoArgs docsWithArgs) diff --git a/Tests/FindDoxygen/SimpleTest/main.cpp b/Tests/FindDoxygen/SimpleTest/main.cpp new file mode 100644 index 0000000..925f0af --- /dev/null +++ b/Tests/FindDoxygen/SimpleTest/main.cpp @@ -0,0 +1,4 @@ +/** + * \file + * \brief One C++ file w/ sample Doxygen comment just to produce any docs... + */ diff --git a/Tests/FindDoxygen/SimpleTest/spaces_in_name.cpp.in b/Tests/FindDoxygen/SimpleTest/spaces_in_name.cpp.in new file mode 100644 index 0000000..c1b9ffd --- /dev/null +++ b/Tests/FindDoxygen/SimpleTest/spaces_in_name.cpp.in @@ -0,0 +1,4 @@ +/** + * \file + * \brief This file name contains spaces + */ diff --git a/Tests/FindGTest/Test/CMakeLists.txt b/Tests/FindGTest/Test/CMakeLists.txt index 99368ac..b65b9d2 100644 --- a/Tests/FindGTest/Test/CMakeLists.txt +++ b/Tests/FindGTest/Test/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(TestFindGTest CXX) include(CTest) -# CMake does not actually provide FindGTest publicly. -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) - find_package(GTest REQUIRED) add_executable(test_gtest_tgt main.cxx) diff --git a/Tests/FindMPI/Test/CMakeLists.txt b/Tests/FindMPI/Test/CMakeLists.txt index 6f177f9..3910c25 100644 --- a/Tests/FindMPI/Test/CMakeLists.txt +++ b/Tests/FindMPI/Test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(TestFindMPI) +project(TestFindMPI NONE) include(CTest) macro(source_code_mapper_helper LANG_NAME) diff --git a/Tests/FindOpenMP/Test/CMakeLists.txt b/Tests/FindOpenMP/Test/CMakeLists.txt index 6313ef6..2692947 100644 --- a/Tests/FindOpenMP/Test/CMakeLists.txt +++ b/Tests/FindOpenMP/Test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(TestFindOpenMP) +project(TestFindOpenMP NONE) include(CTest) macro(source_code_mapper_helper LANG_NAME SRC_FILE_NAME) diff --git a/Tests/FindProtobuf/CMakeLists.txt b/Tests/FindProtobuf/CMakeLists.txt new file mode 100644 index 0000000..1cdb2ae --- /dev/null +++ b/Tests/FindProtobuf/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindProtobuf.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindProtobuf/Test" + "${CMake_BINARY_DIR}/Tests/FindProtobuf/Test" + ${build_generator_args} + --build-project TestFindProtobuf + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt new file mode 100644 index 0000000..8b6e38a --- /dev/null +++ b/Tests/FindProtobuf/Test/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.4) +project(TestFindProtobuf CXX) +include(CTest) + +find_package(Protobuf REQUIRED) + +add_executable(test_tgt main.cxx) +target_link_libraries(test_tgt protobuf::libprotobuf) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.cxx) +target_include_directories(test_var PRIVATE ${Protobuf_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${Protobuf_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) + +add_executable(test_tgt_lite main.cxx) +target_link_libraries(test_tgt_lite protobuf::libprotobuf-lite) +add_test(NAME test_tgt_lite COMMAND test_tgt_lite) + +add_executable(test_var_lite main.cxx) +target_include_directories(test_var_lite PRIVATE ${Protobuf_INCLUDE_DIRS}) +target_link_libraries(test_var_lite PRIVATE ${Protobuf_LITE_LIBRARIES}) +add_test(NAME test_var_lite COMMAND test_var_lite) + +add_executable(test_tgt_protoc main-protoc.cxx) +target_link_libraries(test_tgt_protoc protobuf::libprotoc) +add_test(NAME test_tgt_protoc COMMAND test_tgt_protoc) + +add_executable(test_var_protoc main-protoc.cxx) +target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS}) +target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES}) +add_test(NAME test_var_protoc COMMAND test_var_protoc) diff --git a/Tests/FindProtobuf/Test/main-protoc.cxx b/Tests/FindProtobuf/Test/main-protoc.cxx new file mode 100644 index 0000000..64e5ada --- /dev/null +++ b/Tests/FindProtobuf/Test/main-protoc.cxx @@ -0,0 +1,8 @@ +#include <google/protobuf/compiler/command_line_interface.h> + +int main() +{ + google::protobuf::compiler::CommandLineInterface(); + + return 0; +} diff --git a/Tests/FindProtobuf/Test/main.cxx b/Tests/FindProtobuf/Test/main.cxx new file mode 100644 index 0000000..87d5c12 --- /dev/null +++ b/Tests/FindProtobuf/Test/main.cxx @@ -0,0 +1,8 @@ +#include <google/protobuf/stubs/common.h> + +int main() +{ + GOOGLE_PROTOBUF_VERIFY_VERSION; + + return 0; +} diff --git a/Tests/FindTIFF/Test/CMakeLists.txt b/Tests/FindTIFF/Test/CMakeLists.txt index 6985e3f..85453ed 100644 --- a/Tests/FindTIFF/Test/CMakeLists.txt +++ b/Tests/FindTIFF/Test/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(TestFindTIFF C) include(CTest) -# CMake does not actually provide FindTIFF publicly. -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) - find_package(TIFF REQUIRED) add_executable(test_tiff_tgt main.c) diff --git a/Tests/FindXalanC/Test/CMakeLists.txt b/Tests/FindXalanC/Test/CMakeLists.txt index b445e0e..a8c2a0a 100644 --- a/Tests/FindXalanC/Test/CMakeLists.txt +++ b/Tests/FindXalanC/Test/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(TestFindXalanC CXX) include(CTest) -# CMake does not actually provide FindXalanC publicly. -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) - find_package(XalanC REQUIRED) add_executable(test_xalanc_tgt main.cxx) diff --git a/Tests/FindXercesC/Test/CMakeLists.txt b/Tests/FindXercesC/Test/CMakeLists.txt index 8e7767c..267c6a9 100644 --- a/Tests/FindXercesC/Test/CMakeLists.txt +++ b/Tests/FindXercesC/Test/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(TestFindXercesC CXX) include(CTest) -# CMake does not actually provide FindXercesC publicly. -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) - find_package(XercesC REQUIRED) add_executable(test_xercesc_tgt main.cxx) diff --git a/Tests/GoogleTest/CMakeLists.txt b/Tests/GoogleTest/CMakeLists.txt new file mode 100644 index 0000000..21f8b8b --- /dev/null +++ b/Tests/GoogleTest/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME GoogleTest.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/GoogleTest/Test" + "${CMake_BINARY_DIR}/Tests/GoogleTest/Test" + ${build_generator_args} + --build-project TestGoogleTest + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt new file mode 100644 index 0000000..f798d31 --- /dev/null +++ b/Tests/GoogleTest/Test/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.8) +project(TestGoogleTest) +include(CTest) + +include(GoogleTest) + +find_package(GTest REQUIRED) + +add_executable(test_gtest1 main1.cxx) +target_link_libraries(test_gtest1 GTest::GTest) + +# Simple test of defaults +gtest_add_tests(TARGET test_gtest1 + TEST_LIST testList +) +set(expectedTests + GoogleTest.LinksAndRuns + GoogleTest.ConditionalFail +) +if(NOT testList STREQUAL "${expectedTests}") + message(FATAL_ERROR "Expected test list: ${expectedTests} +Actual test list: ${testList}") +endif() + + +# Same target, different arguments, so use test prefix and suffix to +# differentiate from the above test cases +gtest_add_tests(TARGET test_gtest1 + TEST_LIST testList + TEST_PREFIX "set2." + TEST_SUFFIX ".foo" + EXTRA_ARGS --forceFail +) + +set(expectedTests + set2.GoogleTest.LinksAndRuns.foo + set2.GoogleTest.ConditionalFail.foo +) +if(NOT testList STREQUAL "${expectedTests}") + message(FATAL_ERROR "Expected test list: ${expectedTests} +Actual test list: ${testList}") +endif() + +set_tests_properties(set2.GoogleTest.ConditionalFail.foo PROPERTIES WILL_FAIL YES) + + +# Search specific sources to get the test list +add_executable(test_gtest2 main2.cxx) +target_link_libraries(test_gtest2 GTest::Main) +gtest_add_tests(TARGET test_gtest2 + TEST_LIST testList + SOURCES main2.h +) +set(expectedTests + GoogleTest.SomethingElse + GoogleTest.OffTest1 + GoogleTest.OffTest2 + GoogleTest.OffTest3 +) +if(NOT testList STREQUAL "${expectedTests}") + message(FATAL_ERROR "Expected test list: ${expectedTests} +Actual test list: ${testList}") +endif() +set(disabledTests + GoogleTest.OffTest1 + GoogleTest.OffTest2 + GoogleTest.OffTest3 +) +foreach(T ${disabledTests}) + get_test_property(${T} DISABLED testDisabled) + if(NOT testDisabled) + message(FATAL_ERROR "Test ${T} should be disabled but is not") + endif() +endforeach() + +# Non-keyword form, auto-find sources +add_executable(test_gtest3 main3.cxx) +target_link_libraries(test_gtest3 GTest::Main) +gtest_add_tests(test_gtest3 "" AUTO) +if(NOT TEST GoogleTest.Foo) + message(FATAL_ERROR "Test case GoogleTest.Foo not defined") +endif() +if(NOT TEST GoogleTest.Bar) + message(FATAL_ERROR "Test case GoogleTest.Bar not defined") +endif() + + +# Non-keyword form, explicitly specified sources. Allows a non-target to be +# given for the executable. +add_executable(test_gtest4 main4.cxx) +target_link_libraries(test_gtest4 GTest::Main) +gtest_add_tests($<TARGET_FILE:test_gtest4> "" main4.h) +if(NOT TEST GoogleTest.NoKeywords) + message(FATAL_ERROR "Test case GoogleTest.NoKeywords not defined") +endif() diff --git a/Tests/GoogleTest/Test/main1.cxx b/Tests/GoogleTest/Test/main1.cxx new file mode 100644 index 0000000..03d604b --- /dev/null +++ b/Tests/GoogleTest/Test/main1.cxx @@ -0,0 +1,30 @@ +#include <gtest/gtest.h> + +#include <string> + +namespace { +bool shouldFail = false; +} + +TEST(GoogleTest, LinksAndRuns) +{ + ASSERT_TRUE(true); +} + +TEST(GoogleTest, ConditionalFail) +{ + ASSERT_FALSE(shouldFail); +} + +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + if (argc > 1) { + if (argv[1] != std::string("--forceFail")) { + throw "Unexpected argument"; + } + shouldFail = true; + } + return RUN_ALL_TESTS(); +} diff --git a/Tests/GoogleTest/Test/main2.cxx b/Tests/GoogleTest/Test/main2.cxx new file mode 100644 index 0000000..05ffb4a --- /dev/null +++ b/Tests/GoogleTest/Test/main2.cxx @@ -0,0 +1 @@ +#include "main2.h" diff --git a/Tests/GoogleTest/Test/main2.h b/Tests/GoogleTest/Test/main2.h new file mode 100644 index 0000000..7881c4f --- /dev/null +++ b/Tests/GoogleTest/Test/main2.h @@ -0,0 +1,21 @@ +#include <gtest/gtest.h> + +TEST(GoogleTest, SomethingElse) +{ + ASSERT_TRUE(true); +} + +TEST(GoogleTest, DISABLED_OffTest1) +{ + ASSERT_TRUE(true); +} + +TEST(DISABLED_GoogleTest, OffTest2) +{ + ASSERT_TRUE(true); +} + +TEST(DISABLED_GoogleTest, DISABLED_OffTest3) +{ + ASSERT_TRUE(true); +} diff --git a/Tests/GoogleTest/Test/main3.cxx b/Tests/GoogleTest/Test/main3.cxx new file mode 100644 index 0000000..98ce13c --- /dev/null +++ b/Tests/GoogleTest/Test/main3.cxx @@ -0,0 +1,11 @@ +#include <gtest/gtest.h> + +TEST(GoogleTest, Foo) +{ + ASSERT_TRUE(true); +} + +TEST(GoogleTest, Bar) +{ + ASSERT_TRUE(true); +} diff --git a/Tests/GoogleTest/Test/main4.cxx b/Tests/GoogleTest/Test/main4.cxx new file mode 100644 index 0000000..8023bc1 --- /dev/null +++ b/Tests/GoogleTest/Test/main4.cxx @@ -0,0 +1 @@ +#include "main4.h" diff --git a/Tests/GoogleTest/Test/main4.h b/Tests/GoogleTest/Test/main4.h new file mode 100644 index 0000000..19da12a --- /dev/null +++ b/Tests/GoogleTest/Test/main4.h @@ -0,0 +1,6 @@ +#include <gtest/gtest.h> + +TEST(GoogleTest, NoKeywords) +{ + ASSERT_TRUE(true); +} diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 2657aeb..52d4613 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -48,7 +48,14 @@ macro(set_defines target true_defs false_defs) ) endmacro() +# Only run the compiler detection header test for compilers with +# detailed features tables, not just meta-features + if (CMAKE_C_COMPILE_FEATURES) + set(C_expected_features ${CMAKE_C_COMPILE_FEATURES}) + list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]") +endif() +if (C_expected_features) string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" COMPILER_VERSION_MAJOR "${CMAKE_C_COMPILER_VERSION}") string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" COMPILER_VERSION_MINOR "${CMAKE_C_COMPILER_VERSION}") string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" COMPILER_VERSION_PATCH "${CMAKE_C_COMPILER_VERSION}") @@ -85,7 +92,11 @@ if (CMAKE_C_COMPILE_FEATURES) endif() endif() -if (NOT CMAKE_CXX_COMPILE_FEATURES) +if (CMAKE_CXX_COMPILE_FEATURES) + set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES}) + list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]") +endif() +if (NOT CXX_expected_features) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n" ) diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index f52b479..9e2b4ab 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required (VERSION 2.6) cmake_policy(SET CMP0054 NEW) project(Plugin) +# We need proper C++98 support from the compiler +set(CMAKE_CXX_STANDARD 98) + # Test per-target output directory properties. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) @@ -25,9 +28,6 @@ include_directories( ${Plugin_SOURCE_DIR}/include ) -# We need proper C++98 support from the compiler -set(CMAKE_CXX_STANDARD 98) - # Those versions of the HP compiler that need a flag to get proper C++98 # template support also need a flag to use the newer C++ library. if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index ae0a02b..2ca11e4 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -20,6 +20,16 @@ if (WIN32) 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 "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc" TARGET Qt4GenerateMacroTest diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutoUicInterface/CMakeLists.txt index 70175fb..3ea1294 100644 --- a/Tests/QtAutoUicInterface/CMakeLists.txt +++ b/Tests/QtAutoUicInterface/CMakeLists.txt @@ -53,6 +53,12 @@ set_property(TARGET KI18n APPEND PROPERTY # END upstream +if(${CMAKE_GENERATOR} MATCHES "Visual Studio") +set(INC_DIR "include_${CMAKE_BUILD_TYPE}" ) +else() +set(INC_DIR "include" ) +endif() + add_library(LibWidget libwidget.cpp) target_link_libraries(LibWidget KI18n ${QT_GUI_TARGET}) set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON) @@ -64,6 +70,6 @@ target_link_libraries(MyWidget KI18n ${QT_GUI_TARGET}) add_executable(QtAutoUicInterface main.cpp) target_compile_definitions(QtAutoUicInterface PRIVATE - UI_LIBWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/LibWidget_autogen/include/ui_libwidget.h" - UI_MYWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/MyWidget_autogen/include/ui_mywidget.h" + UI_LIBWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/LibWidget_autogen/${INC_DIR}/ui_libwidget.h" + UI_MYWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/MyWidget_autogen/${INC_DIR}/ui_mywidget.h" ) diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 101b396..89d2b80 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -46,6 +46,35 @@ endif() 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 +# MOC only +add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp) +set_property(TARGET mocOnly PROPERTY AUTOMOC ON) +target_link_libraries(mocOnly ${QT_LIBRARIES}) + +# -- Test +# UIC only +if(ALLOW_WRAP_CPP) + qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) + add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) + set_property(TARGET uicOnly PROPERTY AUTOUIC ON) + target_link_libraries(uicOnly ${QT_LIBRARIES}) +endif() + # -- Test # RCC only add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) @@ -59,13 +88,6 @@ set_property(TARGET rccEmpty PROPERTY AUTORCC ON) target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) # -- Test -# UIC only -qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) -add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) -set_property(TARGET uicOnly PROPERTY AUTOUIC ON) -target_link_libraries(uicOnly ${QT_LIBRARIES}) - -# -- Test # Add not_generated_file.qrc to the source list to get the file-level # dependency, but don't generate a c++ file from it. Disable the AUTORCC # feature for this target. This tests that qrc files in the sources don't @@ -100,7 +122,7 @@ if (NOT RCC_DEPENDS) message(SEND_ERROR "Initial build of rccDepends failed. Output: ${output}") endif() # Get name and timestamp of the output binary -file(STRINGS "${RCC_DEPENDS_BIN}/target.txt" targetList) +file(STRINGS "${RCC_DEPENDS_BIN}/target.txt" targetList ENCODING UTF-8) list(GET targetList 0 rccDependsBin) file(TIMESTAMP "${rccDependsBin}" timeBegin "${timeformat}") # Sleep, touch regular qrc input file, rebuild and compare timestamp @@ -188,7 +210,7 @@ if (NOT MOC_RERUN) message(SEND_ERROR "Initial build of mocRerun failed. Output: ${output}") endif() # Get name and timestamp of the output binary -file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/mocRerun/target1.txt" target1List) +file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/mocRerun/target1.txt" target1List ENCODING UTF-8) list(GET target1List 0 binFile) file(TIMESTAMP "${binFile}" timeBegin "${timeformat}") # Change file content and rebuild @@ -209,25 +231,27 @@ endif() # -- Test # Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target -qtx_wrap_cpp(skipMocWrapMoc - skipSource/qItemA.hpp - skipSource/qItemB.hpp) -set(skipMocSources - skipMoc.cpp - skipSource/qItemA.cpp - skipSource/qItemB.cpp - skipSource/qItemC.cpp) -set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON) -set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON) -# AUTOMOC enabled only -add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) -set_property(TARGET skipMocA PROPERTY AUTOMOC ON) -target_link_libraries(skipMocA ${QT_LIBRARIES}) -# AUTOMOC and AUTOUIC enabled -add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) -set_property(TARGET skipMocB PROPERTY AUTOMOC ON) -set_property(TARGET skipMocB PROPERTY AUTOUIC ON) -target_link_libraries(skipMocB ${QT_LIBRARIES}) +if(ALLOW_WRAP_CPP) + qtx_wrap_cpp(skipMocWrapMoc + skipSource/qItemA.hpp + skipSource/qItemB.hpp) + set(skipMocSources + skipMoc.cpp + skipSource/qItemA.cpp + skipSource/qItemB.cpp + skipSource/qItemC.cpp) + set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON) + set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON) + # AUTOMOC enabled only + add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) + set_property(TARGET skipMocA PROPERTY AUTOMOC ON) + target_link_libraries(skipMocA ${QT_LIBRARIES}) + # AUTOMOC and AUTOUIC enabled + add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) + set_property(TARGET skipMocB PROPERTY AUTOMOC ON) + set_property(TARGET skipMocB PROPERTY AUTOUIC ON) + target_link_libraries(skipMocB ${QT_LIBRARIES}) +endif() # -- Test # Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target @@ -304,10 +328,10 @@ if (NOT QT_TEST_VERSION STREQUAL 4) set(timeformat "%Y%j%H%M%S") set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin") set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") - find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) - find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) - find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) - find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) file(TIMESTAMP "${plAFile}" plABefore "${timeformat}") file(TIMESTAMP "${plBFile}" plBBefore "${timeformat}") diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.cpp b/Tests/QtAutogen/mocOnlySource/StyleA.cpp new file mode 100644 index 0000000..ced1dd1 --- /dev/null +++ b/Tests/QtAutogen/mocOnlySource/StyleA.cpp @@ -0,0 +1,5 @@ +#include "StyleA.hpp" + +StyleA::StyleA() +{ +} diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.hpp b/Tests/QtAutogen/mocOnlySource/StyleA.hpp new file mode 100644 index 0000000..66735b6 --- /dev/null +++ b/Tests/QtAutogen/mocOnlySource/StyleA.hpp @@ -0,0 +1,15 @@ +#ifndef STYLEA_HPP +#define STYLEA_HPP + +#include <QObject> + +/// Q_OBJECT on a single new line +/// +class StyleA : public QObject +{ + Q_OBJECT +public: + StyleA(); +}; + +#endif diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.cpp b/Tests/QtAutogen/mocOnlySource/StyleB.cpp new file mode 100644 index 0000000..bec6c1c --- /dev/null +++ b/Tests/QtAutogen/mocOnlySource/StyleB.cpp @@ -0,0 +1,5 @@ +#include "StyleB.hpp" + +StyleB::StyleB() +{ +} diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.hpp b/Tests/QtAutogen/mocOnlySource/StyleB.hpp new file mode 100644 index 0000000..425daf8 --- /dev/null +++ b/Tests/QtAutogen/mocOnlySource/StyleB.hpp @@ -0,0 +1,16 @@ +#ifndef STYLEB_HPP +#define STYLEB_HPP + +#include <QObject> + +/* clang-format off */ +/// Q_OBJECT behind a brace +/// +class StyleB : public QObject +{ Q_OBJECT +public: + StyleB(); +}; +/* clang-format on */ + +#endif diff --git a/Tests/QtAutogen/mocOnlySource/main.cpp b/Tests/QtAutogen/mocOnlySource/main.cpp new file mode 100644 index 0000000..06f8d81 --- /dev/null +++ b/Tests/QtAutogen/mocOnlySource/main.cpp @@ -0,0 +1,9 @@ +#include "StyleA.hpp" +#include "StyleB.hpp" + +int main(int argv, char** args) +{ + StyleA styleA; + StyleB styleB; + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/CMakeLists.txt b/Tests/QtAutogen/mocPlugin/CMakeLists.txt index 4843c21..f80aa29 100644 --- a/Tests/QtAutogen/mocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/mocPlugin/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.8) +project(mocPlugin CXX) set(CMAKE_AUTOMOC_DEPEND_FILTERS "A_CUSTOM_MACRO" diff --git a/Tests/README b/Tests/README deleted file mode 100644 index 8b2fda8..0000000 --- a/Tests/README +++ /dev/null @@ -1,39 +0,0 @@ -If you think about adding a new testcase then here is a small checklist you -can run through to find a proper place for it. Go through the list from the -beginning and stop once you find something that matches your tests needs, -i.e. if you will test a module and only need the configure mode use the -instructions from section 2, not 3. - -1. Your testcase can run in CMake script mode, i.e. "cmake -P something" - -Put your test in Tests/CMakeTests/ directory as a .cmake.in file. It will be -put into the test binary directory by configure_file(... @ONLY) and run from -there. Use the AddCMakeTest() macro in Tests/CMakeTests/CMakeLists.txt to add -your test to the test runs. - -2. Your test needs CMake to run in configure mode, but will not build anything - -This includes tests that will build something using try_compile() and friends, -but nothing that expects add_executable(), add_library(), or add_test() to run. - -If the test configures the project only once and it must succeed then put it -into the Tests/CMakeOnly/ directory. Create a subdirectory named like your -test and write the CMakeLists.txt you need into that subdirectory. Use the -add_CMakeOnly_test() macro from Tests/CMakeOnly/CMakeLists.txt to add your -test to the test runs. - -If the test configures the project with multiple variations and verifies -success or failure each time then put it into the Tests/RunCMake/ directory. -Read the instructions in Tests/RunCMake/CMakeLists.txt to add a test. - -3. If you are testing something from the Modules directory - -Put your test in the Tests/Modules/ directory. Create a subdirectory there -named after your test. Use the ADD_TEST_MACRO macro from Tests/CMakeLists.txt -to add your test to the test run. If you have put your stuff in -Tests/Modules/Foo then you call it using ADD_TEST_MACRO(Module.Foo Foo). - -4. You are doing other stuff. - -Find a good place ;) In doubt mail to cmake-developers@cmake.org and ask for -advise. diff --git a/Tests/README.rst b/Tests/README.rst new file mode 100644 index 0000000..3e98938 --- /dev/null +++ b/Tests/README.rst @@ -0,0 +1,31 @@ +CMake Tests Directory +********************* + +This directory contains the CMake test suite. +See also the `CMake Source Code Guide`_. + +.. _`CMake Source Code Guide`: ../Help/dev/source.rst + +Many tests exist as immediate subdirectories, but some tests +are organized as follows. + +* ``CMakeLib/``: + Source code, used for tests, that links to the ``CMakeLib`` library + defined over in ``Source/``. + +* ``CMakeOnly/``: + Deprecated. Tests that run CMake to generate a project but not build it. + Superseded by ``Tests/RunCMake/``. + +* ``Find*/``: + Tests for specific find modules that can only be run on machines with + the corresponding packages installed. They are enabled in + ``CMakeLists.txt`` by undocumented options used on CI builds. + +* ``Module/``: + Tests for specific CMake modules. + +* ``RunCMake/``: + Tests that run CMake and/or other tools while precisely checking + their return code and stdout/stderr content. Useful for testing + error cases and diagnostic output. diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake index ef33012..87b0de0 100644 --- a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake +++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake @@ -11,7 +11,7 @@ endif() ]]) endif() -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " set(check_pairs \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/test.manifest\" ) diff --git a/Tests/RunCMake/BuildDepends/C-Exe.cmake b/Tests/RunCMake/BuildDepends/C-Exe.cmake index 5057ca9..ad5cd4d 100644 --- a/Tests/RunCMake/BuildDepends/C-Exe.cmake +++ b/Tests/RunCMake/BuildDepends/C-Exe.cmake @@ -2,7 +2,7 @@ enable_language(C) add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c) -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " set(check_pairs \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\" ) diff --git a/Tests/RunCMake/BuildDepends/Custom-Always.cmake b/Tests/RunCMake/BuildDepends/Custom-Always.cmake index d412708..c7e7fb0 100644 --- a/Tests/RunCMake/BuildDepends/Custom-Always.cmake +++ b/Tests/RunCMake/BuildDepends/Custom-Always.cmake @@ -16,7 +16,7 @@ add_custom_command( add_custom_target(drive ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/after-always) -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/always-updated|${CMAKE_CURRENT_BINARY_DIR}/before-always\" \"${CMAKE_CURRENT_BINARY_DIR}/after-always|${CMAKE_CURRENT_BINARY_DIR}/always-updated\" diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake index 687c827..1e1f22a 100644 --- a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake +++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake @@ -16,7 +16,7 @@ add_custom_command( add_custom_target(drive ALL DEPENDS use-byproduct) add_dependencies(drive produce) -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " if (check_step EQUAL 1) set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\" diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake index 0f92e0e..8b2ae78 100644 --- a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake @@ -6,7 +6,7 @@ add_custom_command( add_custom_target(generate ALL DEPENDS output.cxx) set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}) -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\" ) diff --git a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake index add9aeb..af6ad86 100644 --- a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake +++ b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake @@ -3,7 +3,7 @@ get_filename_component(include_dir "${CMAKE_BINARY_DIR}" PATH) include_directories("${include_dir}") add_executable(MakeInProjectOnly MakeInProjectOnly.c) set(CMAKE_DEPENDS_IN_PROJECT_ONLY 1) -file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " if (check_step EQUAL 1) set(check_pairs \"$<TARGET_FILE:MakeInProjectOnly>|${include_dir}/MakeInProjectOnly.h\" diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt index f672285..5d39214 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -4,13 +4,13 @@ CMake Warning \(dev\) in CMakeLists.txt: cmake_policy command to set the policy and suppress this warning. Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from - its LINK_INTERFACE_LIBRARIES properties. + its LINK_INTERFACE_LIBRARIES(_DEBUG)? properties. INTERFACE_LINK_LIBRARIES: foo - LINK_INTERFACE_LIBRARIES: + LINK_INTERFACE_LIBRARIES(_DEBUG)?: bat diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake index 11b4e22..03223e8 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake @@ -5,7 +5,9 @@ add_library(foo SHARED empty_vs6_1.cpp) add_library(bar SHARED empty_vs6_2.cpp) add_library(bat SHARED empty_vs6_3.cpp) target_link_libraries(bar LINK_PUBLIC foo) +# Replace the compatibility values set by target_link_libraries set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat) +set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES_DEBUG bat) add_library(user SHARED empty.cpp) target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake index 23fae13..6968c8b 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake.cmake @@ -1,6 +1,6 @@ cmake_policy(SET CMP0069 NEW) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE NO) +set(_CMAKE_CXX_IPO_SUPPORTED_BY_CMAKE NO) add_executable(foo main.cpp) set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake index 24b409a..ecb197b 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler.cmake @@ -1,7 +1,7 @@ cmake_policy(SET CMP0069 NEW) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) -set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) +set(_CMAKE_CXX_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_CXX_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) add_executable(foo main.cpp) set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake index df2a888..80d4e15 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator.cmake @@ -1,7 +1,7 @@ cmake_policy(SET CMP0069 NEW) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) -set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) +set(_CMAKE_CXX_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_CXX_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) add_executable(foo main.cpp) set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake b/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake index 0e3e670..2049c9e 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake +++ b/Tests/RunCMake/CMP0069/CMP0069-WARN.cmake @@ -1,4 +1,4 @@ -set(_CMAKE_IPO_LEGACY_BEHAVIOR NO) +set(_CMAKE_CXX_IPO_LEGACY_BEHAVIOR NO) add_executable(foo main.cpp) set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) diff --git a/Tests/RunCMake/CMP0069/RunCMakeTest.cmake b/Tests/RunCMake/CMP0069/RunCMakeTest.cmake index 61ba458..f44f840 100644 --- a/Tests/RunCMake/CMP0069/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0069/RunCMakeTest.cmake @@ -5,7 +5,6 @@ run_cmake(CMP0069-NEW-cmake) run_cmake(CMP0069-NEW-compiler) run_cmake(CMP0069-WARN) -string(COMPARE EQUAL "${RunCMake_GENERATOR}" "Xcode" is_xcode) -if(is_xcode OR RunCMake_GENERATOR MATCHES "^Visual Studio ") +if(RunCMake_GENERATOR MATCHES "^Visual Studio ") run_cmake(CMP0069-NEW-generator) endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 75d4e29..0369fa4 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -147,7 +147,7 @@ endif() add_RunCMake_test(GeneratorExpression) add_RunCMake_test(GeneratorPlatform) add_RunCMake_test(GeneratorToolset) -add_RunCMake_test(GNUInstallDirs) +add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(LinkStatic) @@ -181,8 +181,10 @@ add_RunCMake_test(add_custom_target) add_RunCMake_test(add_dependencies) add_RunCMake_test(add_subdirectory) add_RunCMake_test(build_command) +add_executable(exit_code exit_code.c) +set(execute_process_ARGS -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>) if(NOT CMake_TEST_EXTERNAL_CMAKE) - set(execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) + list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) endif() add_RunCMake_test(execute_process) add_RunCMake_test(export) @@ -341,6 +343,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") add_RunCMake_test(ClangTidy -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>) add_RunCMake_test(IncludeWhatYouUse -DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu>) add_RunCMake_test(Cpplint -DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>) + if(DEFINED CMake_TEST_CUDA) + list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) + endif() add_RunCMake_test(CompilerLauncher) endif() diff --git a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake index ce039f5..99d3155 100644 --- a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake +++ b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake @@ -33,7 +33,7 @@ function(getPackageContentList FILE RESULT_VAR) endfunction() function(toExpectedContentList FILE_NO CONTENT_VAR) - findExpectedFile("${FILE_NO}" "file_") + findExpectedFile("${FILE_NO}" "file_" "glob_expr_") # component and monolithic packages differ for some reason by either having # package filename prefix in path or not diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 8ca7126..faf151a 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -5,7 +5,7 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") # run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES" run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT") -run_cpack_test(CUSTOM_NAMES "RPM;DEB" true "COMPONENT") +run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT") run_cpack_test(DEBUGINFO "RPM" true "COMPONENT") run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT") run_cpack_test(DIST "RPM" false "MONOLITHIC") @@ -24,5 +24,6 @@ run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_co run_cpack_test(EXTRA_SLASH_IN_PATH "RPM" true "COMPONENT") run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") +run_cpack_test(SYMLINKS "RPM;TGZ" false "MONOLITHIC;COMPONENT") run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/STGZ/Helpers.cmake b/Tests/RunCMake/CPack/STGZ/Helpers.cmake index 08224d3..68b1eab 100644 --- a/Tests/RunCMake/CPack/STGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/STGZ/Helpers.cmake @@ -35,7 +35,7 @@ function(getPackageContentList FILE RESULT_VAR) endfunction() function(toExpectedContentList FILE_NO CONTENT_VAR) - findExpectedFile("${FILE_NO}" "file_") + findExpectedFile("${FILE_NO}" "file_" "glob_expr_") get_filename_component(prefix_ "${file_}" NAME) # NAME_WE removes everything after the dot and dot is in version so replace instead diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 59751a7..470ebf7 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR) -function(findExpectedFile FILE_NO RESULT_VAR) +function(findExpectedFile FILE_NO RESULT_VAR GLOBING_EXPR_VAR) if(NOT DEFINED EXPECTED_FILE_${FILE_NO}) # explicit file name regex was not provided - construct one from other data # set defaults if parameters are not provided if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_NAME) @@ -21,6 +21,7 @@ function(findExpectedFile FILE_NO RESULT_VAR) file(GLOB found_file_ RELATIVE "${bin_dir}" "${EXPECTED_FILE_${FILE_NO}}") set(${RESULT_VAR} "${found_file_}" PARENT_SCOPE) + set(${GLOBING_EXPR_VAR} "${EXPECTED_FILE_${FILE_NO}}" PARENT_SCOPE) endfunction() include("${config_file}") @@ -39,7 +40,8 @@ include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/ExpectedFiles.cmake") # check that expected generated files exist and contain expected content if(NOT EXPECTED_FILES_COUNT EQUAL 0) foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT}) - findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}") + findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}" + "EXPECTED_FILE_${file_no_}") list(APPEND foundFiles_ "${FOUND_FILE_${file_no_}}") list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake index ae5f0af..5cb280c 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake @@ -9,4 +9,7 @@ set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") string(TOLOWER "${GENERATOR_TYPE}" file_extension_) set(EXPECTED_FILE_3 "pkg_3_abc.${file_extension_}") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(EXPECTED_FILE_2 "second.tar.gz") + set(EXPECTED_FILE_3 "pkg_3_abc.tar.gz") endif() diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake index 0c2b37b..4c20e41 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -7,6 +7,9 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") string(TOLOWER "${GENERATOR_TYPE}" file_extension_) set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_3_FILE_NAME "pkg_3_abc.${file_extension_}") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(CPACK_ARCHIVE_PKG_2_FILE_NAME "second") + set(CPACK_ARCHIVE_PKG_3_FILE_NAME "pkg_3_abc") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake new file mode 100644 index 0000000..05be748 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/ExpectedFiles.cmake @@ -0,0 +1,13 @@ +set(EXPECTED_FILES_COUNT "1") + +set(EXPECTED_FILE_CONTENT_1_LIST + "/usr" + "/usr/empty_dir" + "/usr/non_empty_dir" + "/usr/non_empty_dir/CMakeLists.txt" + "/usr/symlink_to_empty_dir" + "/usr/symlink_to_non_empty_dir") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILE_1_COMPONENT "links") +endif() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake new file mode 100644 index 0000000..f3df46b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/TGZ-Prerequirements.cmake @@ -0,0 +1,5 @@ +function(get_test_prerequirements found_var config_file) + if(UNIX) # limit test to platforms that support symlinks + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake new file mode 100644 index 0000000..0632319 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/VerifyResult.cmake @@ -0,0 +1,26 @@ +set(whitespaces "[\\t\\n\\r ]*") + +####################### +# verify generated symbolic links +####################### +file(GLOB_RECURSE symlink_files RELATIVE "${bin_dir}" "${bin_dir}/*/symlink_*") + +foreach(check_symlink IN LISTS symlink_files) + get_filename_component(symlink_name "${check_symlink}" NAME) + execute_process(COMMAND ls -la "${check_symlink}" + WORKING_DIRECTORY "${bin_dir}" + OUTPUT_VARIABLE SYMLINK_POINT_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if("${symlink_name}" STREQUAL "symlink_to_empty_dir") + string(REGEX MATCH "^.*${whitespaces}->${whitespaces}empty_dir$" check_symlink "${SYMLINK_POINT_}") + elseif("${symlink_name}" STREQUAL "symlink_to_non_empty_dir") + string(REGEX MATCH "^.*${whitespaces}->${whitespaces}non_empty_dir$" check_symlink "${SYMLINK_POINT_}") + else() + message(FATAL_ERROR "error: unexpected rpm symbolic link '${check_symlink}'") + endif() + + if(NOT check_symlink) + message(FATAL_ERROR "symlink points to unexpected location '${SYMLINK_POINT_}'") + endif() +endforeach() diff --git a/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake b/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake new file mode 100644 index 0000000..fef765c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SYMLINKS/test.cmake @@ -0,0 +1,14 @@ +install(DIRECTORY DESTINATION empty_dir COMPONENT links) +install(FILES CMakeLists.txt DESTINATION non_empty_dir COMPONENT links) + +# test symbolic link to an empty dir +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink empty_dir symlink_to_empty_dir) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_to_empty_dir DESTINATION "." COMPONENT links) + +# test symbolic link to a non empty dir +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink non_empty_dir symlink_to_non_empty_dir) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_to_non_empty_dir DESTINATION "." COMPONENT links) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL links) +endif() diff --git a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake index 1a373b9..8fc1218 100644 --- a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake +++ b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake @@ -1,6 +1,6 @@ add_executable(mytest test.cpp) -file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[ set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") ]]) diff --git a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake index 77fe8ed..b23d3c7 100644 --- a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake +++ b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake @@ -6,7 +6,7 @@ foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES) OUTPUT_NAME_${UPPER_CONFIG} bar_${CONFIG}) endforeach() -file(GENERATE OUTPUT runtest_info_$<CONFIG>.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info_$<CONFIG>.cmake CONTENT [[ set(CPACK_BUILD_CONFIG "$<CONFIG>") set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") ]]) diff --git a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake index 2e1d465..2001d9f 100644 --- a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake +++ b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake @@ -1,6 +1,6 @@ add_executable(mytest test.cpp) -file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[ set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>") ]]) diff --git a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake index 588a75d..e145569 100644 --- a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake @@ -8,6 +8,6 @@ run_cmake(not-supported-by-compiler) run_cmake(save-to-result) run_cmake(cmp0069-is-old) -if(RunCMake_GENERATOR MATCHES "^(Visual Studio |Xcode$)") +if(RunCMake_GENERATOR MATCHES "^Visual Studio ") run_cmake(not-supported-by-generator) endif() diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt index f63f30f..c49a024 100644 --- a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): - IPO is not supported \(CMake doesn't support IPO for current compiler\)\. + IPO is not supported \(CMake doesn't support IPO for current C compiler\)\. Call Stack \(most recent call first\): .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) not-supported-by-cmake\.cmake:[0-9]+ \(check_ipo_supported\) diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake index 6f61f7e..e583dd0 100644 --- a/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-cmake.cmake @@ -1,3 +1,3 @@ project(${RunCMake_TEST} LANGUAGES C) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE NO) +set(_CMAKE_C_IPO_SUPPORTED_BY_CMAKE NO) check_ipo_supported() diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt index 5f5f410..675c2d3 100644 --- a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\): - IPO is not supported \(Compiler doesn't support IPO\)\. + IPO is not supported \(C compiler doesn't support IPO\)\. Call Stack \(most recent call first\): .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\) not-supported-by-compiler\.cmake:[0-9]+ \(check_ipo_supported\) diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake index 652cfd5..86c8f8d 100644 --- a/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-compiler.cmake @@ -1,4 +1,4 @@ project(${RunCMake_TEST} LANGUAGES C) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) -set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) +set(_CMAKE_C_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_C_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) check_ipo_supported() diff --git a/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake index dc0fa09..c32af6e 100644 --- a/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake +++ b/Tests/RunCMake/CheckIPOSupported/not-supported-by-generator.cmake @@ -1,6 +1,6 @@ project(${RunCMake_TEST} LANGUAGES C) -set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES) -set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) +set(_CMAKE_C_IPO_SUPPORTED_BY_CMAKE YES) +set(_CMAKE_C_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) check_ipo_supported() diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 2d14a9e..b24a680 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -6,9 +6,10 @@ add_library(empty3 INTERFACE) target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 - # When starting, $<COMPILE_FEATURES:cxx_auto_type> is '0', so 'freeze' the + # When starting, $<COMPILE_FEATURES:cxx_std_11> is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$<COMPILE_FEATURES:cxx_auto_type>:empty2> + $<$<COMPILE_FEATURES:cxx_std_11>:empty2> + # This would add cxx_std_11, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 8dc627d..5a70da2 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -1,3 +1,4 @@ +cmake_policy(SET CMP0057 NEW) include(RunCMake) run_cmake(NotAFeature) @@ -28,13 +29,13 @@ endif() if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) -else() +elseif (cxx_std_98 IN_LIST CXX_FEATURES AND cxx_std_11 IN_LIST CXX_FEATURES) if(CXX_STANDARD_DEFAULT EQUAL 98) run_cmake(LinkImplementationFeatureCycle) endif() run_cmake(LinkImplementationFeatureCycleSolved) - if (";${CXX_FEATURES};" MATCHES ";cxx_final;") + if (cxx_final IN_LIST CXX_FEATURES) set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") endif() run_cmake(NonValidTarget1) diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt new file mode 100644 index 0000000..3313e31 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt @@ -0,0 +1 @@ +.*-E env USED_LAUNCHER=1.* diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake new file mode 100644 index 0000000..6b4b816 --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(CUDA.cmake) diff --git a/Tests/RunCMake/CompilerLauncher/CUDA.cmake b/Tests/RunCMake/CompilerLauncher/CUDA.cmake new file mode 100644 index 0000000..fe5560b --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/CUDA.cmake @@ -0,0 +1,4 @@ +enable_language(CUDA) +set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1") +set(CMAKE_VERBOSE_MAKEFILE TRUE) +add_executable(main main.cu) diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake index 5884d5c..ab26512 100644 --- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake @@ -15,9 +15,14 @@ function(run_compiler_launcher lang) run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args}) endfunction() -run_compiler_launcher(C) -run_compiler_launcher(CXX) -if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") - run_compiler_launcher(C-launch) - run_compiler_launcher(CXX-launch) +set(langs C CXX) +if(CMake_TEST_CUDA) + list(APPEND langs CUDA) endif() + +foreach(lang ${langs}) + run_compiler_launcher(${lang}) + if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") + run_compiler_launcher(${lang}-launch) + endif() +endforeach() diff --git a/Tests/RunCMake/CompilerLauncher/main.cu b/Tests/RunCMake/CompilerLauncher/main.cu new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/RunCMake/CompilerLauncher/main.cu @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} diff --git a/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake new file mode 100644 index 0000000..05ec26e --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake @@ -0,0 +1,13 @@ +foreach(f + "${RunCMake_TEST_SOURCE_DIR}/relative-input-NEW.txt" + "${RunCMake_TEST_BINARY_DIR}/relative-output-NEW.txt" + ) + if(EXISTS "${f}") + file(READ "${f}" content) + if(NOT content MATCHES "^relative-input-NEW[\r\n]*$") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") + endif() +endforeach() diff --git a/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake b/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake new file mode 100644 index 0000000..1a03822 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0070 NEW) +file(GENERATE OUTPUT relative-output-NEW.txt INPUT relative-input-NEW.txt) diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake new file mode 100644 index 0000000..a71d822 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake @@ -0,0 +1,13 @@ +foreach(f + "${RunCMake_TEST_BINARY_DIR}/relative-input-OLD.txt" + "${RunCMake_TEST_BINARY_DIR}/relative-output-OLD.txt" + ) + if(EXISTS "${f}") + file(READ "${f}" content) + if(NOT content MATCHES "^relative-input-OLD[\r\n]*$") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") + endif() +endforeach() diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake b/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake new file mode 100644 index 0000000..0fb47cd --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0070 OLD) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/relative-input-OLD.txt "relative-input-OLD\n") +file(GENERATE OUTPUT relative-output-OLD.txt INPUT relative-input-OLD.txt) diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake new file mode 100644 index 0000000..1488df0 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake @@ -0,0 +1,13 @@ +foreach(f + "${RunCMake_TEST_BINARY_DIR}/relative-input-WARN.txt" + "${RunCMake_TEST_BINARY_DIR}/relative-output-WARN.txt" + ) + if(EXISTS "${f}") + file(READ "${f}" content) + if(NOT content MATCHES "^relative-input-WARN[\r\n]*$") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + endif() + else() + string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") + endif() +endforeach() diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt b/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt new file mode 100644 index 0000000..dbabaa9 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt @@ -0,0 +1,27 @@ +^CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0070 is not set: Define file\(GENERATE\) behavior for relative + paths. Run "cmake --help-policy CMP0070" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + file\(GENERATE\) given relative INPUT path: + + relative-input-WARN.txt + + This is not defined behavior unless CMP0070 is set to NEW. For + compatibility with older versions of CMake, the previous undefined behavior + will be used. +This warning is for project developers. Use -Wno-dev to suppress it.( ++ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0070 is not set: Define file\(GENERATE\) behavior for relative + paths. Run "cmake --help-policy CMP0070" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + file\(GENERATE\) given relative OUTPUT path: + + relative-output-WARN.txt + + This is not defined behavior unless CMP0070 is set to NEW. For + compatibility with older versions of CMake, the previous undefined behavior + will be used. +This warning is for project developers. Use -Wno-dev to suppress it.)+$ diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake b/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake new file mode 100644 index 0000000..ccb0452 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake @@ -0,0 +1,2 @@ +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/relative-input-WARN.txt "relative-input-WARN\n") +file(GENERATE OUTPUT relative-output-WARN.txt INPUT relative-input-WARN.txt) diff --git a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake index e2b081d..59ccf19 100644 --- a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake +++ b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake @@ -7,6 +7,6 @@ target_compile_options(empty ) file(GENERATE - OUTPUT opts-$<COMPILE_LANGUAGE>.txt + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opts-$<COMPILE_LANGUAGE>.txt CONTENT "$<TARGET_PROPERTY:empty,COMPILE_OPTIONS>\n" ) diff --git a/Tests/RunCMake/File_Generate/ReRunCMake.cmake b/Tests/RunCMake/File_Generate/ReRunCMake.cmake index 109d60e..541d86d 100644 --- a/Tests/RunCMake/File_Generate/ReRunCMake.cmake +++ b/Tests/RunCMake/File_Generate/ReRunCMake.cmake @@ -1,5 +1,5 @@ file(GENERATE - OUTPUT output_file.txt + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_file.txt" INPUT "${CMAKE_CURRENT_BINARY_DIR}/input_file.txt" ) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index 82e903d..b660463 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -1,5 +1,9 @@ include(RunCMake) +run_cmake(CMP0070-NEW) +run_cmake(CMP0070-OLD) +run_cmake(CMP0070-WARN) + run_cmake(CommandConflict) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode") run_cmake(OutputConflict) diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake index d1d832a..bb36a4c 100644 --- a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake +++ b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake @@ -1,5 +1,5 @@ file(GENERATE - OUTPUT output_file.txt + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output_file.txt CONTENT "123" ) diff --git a/Tests/RunCMake/File_Generate/relative-input-NEW.txt b/Tests/RunCMake/File_Generate/relative-input-NEW.txt new file mode 100644 index 0000000..7293e90 --- /dev/null +++ b/Tests/RunCMake/File_Generate/relative-input-NEW.txt @@ -0,0 +1 @@ +relative-input-NEW diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake index 3d62a8a..4f42459 100644 --- a/Tests/RunCMake/Framework/FrameworkLayout.cmake +++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake @@ -22,4 +22,4 @@ set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir) add_custom_command(TARGET Framework POST_BUILD COMMAND /usr/bin/file $<TARGET_FILE:Framework>) -file(GENERATE OUTPUT FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n") +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n") diff --git a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt index 8d90f5f..f664db9 100644 --- a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt +++ b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt @@ -1 +1,3 @@ -.*/Framework: Mach-O[^\n]* dynamically linked shared library.* +.*/Framework:( Mach-O universal binary with [^ +]*)? Mach-O[^ +]* dynamically linked shared library.* diff --git a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt index c9f50b6..532cfed 100644 --- a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt +++ b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt @@ -1 +1,2 @@ -.*/Framework: current ar archive random library.* +.*/Framework:( Mach-O universal binary with [^ +]*)? current ar archive random library.* diff --git a/Tests/RunCMake/GNUInstallDirs/Common.cmake b/Tests/RunCMake/GNUInstallDirs/Common.cmake index 5f119af..919cd91 100644 --- a/Tests/RunCMake/GNUInstallDirs/Common.cmake +++ b/Tests/RunCMake/GNUInstallDirs/Common.cmake @@ -1,8 +1,5 @@ set(CMAKE_SIZEOF_VOID_P 8) set(CMAKE_LIBRARY_ARCHITECTURE "arch") -if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - set(CMAKE_SYSTEM_NAME "OpenBSD-Fake") -endif() include(GNUInstallDirs) set(dirs BINDIR diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt new file mode 100644 index 0000000..09ae303 --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt @@ -0,0 +1,30 @@ +^CMAKE_INSTALL_BINDIR='bin' +CMAKE_INSTALL_DATADIR='share' +CMAKE_INSTALL_DATAROOTDIR='share' +CMAKE_INSTALL_DOCDIR='share/doc/Opt' +CMAKE_INSTALL_INCLUDEDIR='include' +CMAKE_INSTALL_INFODIR='info' +CMAKE_INSTALL_LIBDIR='(lib|lib64)' +CMAKE_INSTALL_LIBEXECDIR='libexec' +CMAKE_INSTALL_LOCALEDIR='share/locale' +CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' +CMAKE_INSTALL_MANDIR='man' +CMAKE_INSTALL_SBINDIR='sbin' +CMAKE_INSTALL_SHAREDSTATEDIR='com' +CMAKE_INSTALL_SYSCONFDIR='etc' +CMAKE_INSTALL_FULL_BINDIR='/opt/Opt/bin' +CMAKE_INSTALL_FULL_DATADIR='/opt/Opt/share' +CMAKE_INSTALL_FULL_DATAROOTDIR='/opt/Opt/share' +CMAKE_INSTALL_FULL_DOCDIR='/opt/Opt/share/doc/Opt' +CMAKE_INSTALL_FULL_INCLUDEDIR='/opt/Opt/include' +CMAKE_INSTALL_FULL_INFODIR='/opt/Opt/info' +CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)' +CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec' +CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale' +CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt' +CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/man' +CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin' +CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com' +CMAKE_INSTALL_FULL_SYSCONFDIR='/etc/opt/Opt'$ diff --git a/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt new file mode 100644 index 0000000..4be66bc --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt @@ -0,0 +1,30 @@ +^CMAKE_INSTALL_BINDIR='usr/bin' +CMAKE_INSTALL_DATADIR='usr/share' +CMAKE_INSTALL_DATAROOTDIR='usr/share' +CMAKE_INSTALL_DOCDIR='usr/share/doc/Root' +CMAKE_INSTALL_INCLUDEDIR='usr/include' +CMAKE_INSTALL_INFODIR='usr/info' +CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)' +CMAKE_INSTALL_LIBEXECDIR='usr/libexec' +CMAKE_INSTALL_LOCALEDIR='usr/share/locale' +CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' +CMAKE_INSTALL_MANDIR='usr/man' +CMAKE_INSTALL_SBINDIR='usr/sbin' +CMAKE_INSTALL_SHAREDSTATEDIR='usr/com' +CMAKE_INSTALL_SYSCONFDIR='etc' +CMAKE_INSTALL_FULL_BINDIR='/usr/bin' +CMAKE_INSTALL_FULL_DATADIR='/usr/share' +CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share' +CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Root' +CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include' +CMAKE_INSTALL_FULL_INFODIR='/usr/info' +CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)' +CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' +CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' +CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' +CMAKE_INSTALL_FULL_MANDIR='/usr/man' +CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' +CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' +CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$ diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake index f88569a..b544ba6 100644 --- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake +++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake @@ -1,6 +1,17 @@ include(RunCMake) -run_cmake(Opt) -run_cmake(Root) -run_cmake(Usr) -run_cmake(UsrLocal) +if(SYSTEM_NAME MATCHES "^(.*BSD|DragonFly)$") + set(EXPECT_BSD 1) +endif() + +foreach(case + Opt + Root + Usr + UsrLocal + ) + if(EXPECT_BSD) + set(RunCMake-stderr-file ${case}-BSD-stderr.txt) + endif() + run_cmake(${case}) +endforeach() diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt new file mode 100644 index 0000000..3d7b4c8 --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt @@ -0,0 +1,30 @@ +^CMAKE_INSTALL_BINDIR='bin' +CMAKE_INSTALL_DATADIR='share' +CMAKE_INSTALL_DATAROOTDIR='share' +CMAKE_INSTALL_DOCDIR='share/doc/Usr' +CMAKE_INSTALL_INCLUDEDIR='include' +CMAKE_INSTALL_INFODIR='info' +CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)' +CMAKE_INSTALL_LIBEXECDIR='libexec' +CMAKE_INSTALL_LOCALEDIR='share/locale' +CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' +CMAKE_INSTALL_MANDIR='man' +CMAKE_INSTALL_SBINDIR='sbin' +CMAKE_INSTALL_SHAREDSTATEDIR='com' +CMAKE_INSTALL_SYSCONFDIR='etc' +CMAKE_INSTALL_FULL_BINDIR='/usr/bin' +CMAKE_INSTALL_FULL_DATADIR='/usr/share' +CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share' +CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Usr' +CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include' +CMAKE_INSTALL_FULL_INFODIR='/usr/info' +CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)' +CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' +CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' +CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' +CMAKE_INSTALL_FULL_MANDIR='/usr/man' +CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' +CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' +CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$ diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt new file mode 100644 index 0000000..e1425d5 --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt @@ -0,0 +1,30 @@ +^CMAKE_INSTALL_BINDIR='bin' +CMAKE_INSTALL_DATADIR='share' +CMAKE_INSTALL_DATAROOTDIR='share' +CMAKE_INSTALL_DOCDIR='share/doc/UsrLocal' +CMAKE_INSTALL_INCLUDEDIR='include' +CMAKE_INSTALL_INFODIR='info' +CMAKE_INSTALL_LIBDIR='(lib|lib64)' +CMAKE_INSTALL_LIBEXECDIR='libexec' +CMAKE_INSTALL_LOCALEDIR='share/locale' +CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' +CMAKE_INSTALL_MANDIR='man' +CMAKE_INSTALL_SBINDIR='sbin' +CMAKE_INSTALL_SHAREDSTATEDIR='com' +CMAKE_INSTALL_SYSCONFDIR='etc' +CMAKE_INSTALL_FULL_BINDIR='/usr/local/bin' +CMAKE_INSTALL_FULL_DATADIR='/usr/local/share' +CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/local/share' +CMAKE_INSTALL_FULL_DOCDIR='/usr/local/share/doc/UsrLocal' +CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/local/include' +CMAKE_INSTALL_FULL_INFODIR='/usr/local/info' +CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)' +CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec' +CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale' +CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run' +CMAKE_INSTALL_FULL_MANDIR='/usr/local/man' +CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin' +CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com' +CMAKE_INSTALL_FULL_SYSCONFDIR='/usr/local/etc'$ diff --git a/Tests/RunCMake/Ninja/CommandConcat.cmake b/Tests/RunCMake/Ninja/CommandConcat.cmake new file mode 100644 index 0000000..790cf9d --- /dev/null +++ b/Tests/RunCMake/Ninja/CommandConcat.cmake @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.7) +project(concat_cmd NONE) +set(output1 ${CMAKE_BINARY_DIR}/out1.txt) +set(output2 ${CMAKE_BINARY_DIR}/out2.txt) +file(REMOVE ${output1} ${output2}) +# Check that second command runs if first command contains "||" which has higher precedence than "&&" on Windows +add_custom_target(concat_cmd ALL + COMMAND ${CMAKE_COMMAND} -E echo "Hello || pipe world" && ${CMAKE_COMMAND} -E touch ${output1} || exit 1 + COMMAND ${CMAKE_COMMAND} -E touch ${output2}) +# Check output +add_custom_target(check_output ALL + COMMAND ${CMAKE_COMMAND} -E copy ${output1} ${output1}.copy + COMMAND ${CMAKE_COMMAND} -E copy ${output2} ${output2}.copy) +add_dependencies(check_output concat_cmd) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 8c3bc20..b3720fb 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -40,6 +40,16 @@ run_CMP0058(NEW-by) run_cmake(CustomCommandDepfile) +function(run_CommandConcat) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommandConcat-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(CommandConcat) + run_cmake_command(CommandConcat-build ${CMAKE_COMMAND} --build .) +endfunction() +run_CommandConcat() + function(run_SubDir) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build) diff --git a/Tests/RunCMake/TargetObjects/NoTarget.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake index 5d7e33e..268577d 100644 --- a/Tests/RunCMake/TargetObjects/NoTarget.cmake +++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake @@ -1,7 +1,7 @@ add_library(iface INTERFACE) target_sources(iface INTERFACE $<TARGET_OBJECTS:NoTarget>) -file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:NoTarget>) -file(GENERATE OUTPUT test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $<TARGET_OBJECTS:NoTarget>) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>) install(FILES $<TARGET_OBJECTS:NoTarget> DESTINATION objects) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake index 8e5fdd0..3bb3e37 100644 --- a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake @@ -1,3 +1,3 @@ add_library(StaticLib empty.cpp) -file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $<TARGET_OBJECTS:StaticLib>) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 3af877f..6e7c2f3 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -4,3 +4,4 @@ run_cmake(VsTargetsFileReferences) run_cmake(VsCustomProps) run_cmake(VsDebuggerWorkingDir) run_cmake(VsCSharpCustomTags) +run_cmake(VsCSharpReferenceProps) diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake index 70ea193..9eb4619 100644 --- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake +++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake @@ -4,20 +4,31 @@ if(NOT EXISTS "${csProjectFile}") return() endif() -set(tagFound FALSE) +# test VS_CSHARP_* for the following extensions +set(fileExtensions + "cs" + "png" + "jpg" + "xml" + "settings") +# set(tagName "MyCustomTag") set(tagValue "MyCustomValue") file(STRINGS "${csProjectFile}" lines) -foreach(line IN LISTS lines) - if(line MATCHES "^ *<${tagName}>${tagValue}</${tagName}>") - message(STATUS "foo.csproj has tag ${tagName} with value ${tagValue} defined") - set(tagFound TRUE) + +foreach(e ${fileExtensions}) + string(TOUPPER ${e} eUC) + set(tagFound FALSE) + foreach(line IN LISTS lines) + if(line MATCHES "^ *<${tagName}${eUC}>${tagValue}${eUC}</${tagName}${eUC}>") + message(STATUS "foo.csproj has tag ${tagName}${eUC} with value ${tagValue}${eUC} defined") + set(tagFound TRUE) + endif() + endforeach() + if(NOT tagFound) + set(RunCMake_TEST_FAILED "Source file tag ${tagName}${eUC} with value ${tagValue}${eUC} not found.") + return() endif() endforeach() - -if(NOT tagFound) - set(RunCMake_TEST_FAILED "Source file tag ${tagName} with value ${tagValue} not found.") - return() -endif() diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake index c51e9c3..45766a0 100644 --- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake +++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake @@ -1,11 +1,27 @@ enable_language(CSharp) -add_library(foo foo.cs) -set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props") +# test VS_CSHARP_* for the following extensions +set(fileExtensions + "cs" + "png" + "jpg" + "xml" + "settings") +# set(tagName "MyCustomTag") set(tagValue "MyCustomValue") -set_source_files_properties(foo.cs - PROPERTIES - VS_CSHARP_${tagName} "${tagValue}") +set(fileNames) +foreach(e ${fileExtensions}) + set(currentFile "${CMAKE_CURRENT_BINARY_DIR}/foo.${e}") + list(APPEND fileNames ${currentFile}) + execute_process(COMMAND ${CMAKE_COMMAND} -E touch + "${currentFile}") + string(TOUPPER ${e} eUC) + set_source_files_properties("${currentFile}" + PROPERTIES + VS_CSHARP_${tagName}${eUC} "${tagValue}${eUC}") +endforeach() + +add_library(foo ${fileNames}) diff --git a/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake new file mode 100644 index 0000000..8b9bb67 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake @@ -0,0 +1,49 @@ +set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj") +if(NOT EXISTS "${csProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.") + return() +endif() + +set(test1Reference "System") +set(test1Tag "Hello") +set(test1Value "World") + +set(test2Reference "foo2") +set(test2Tag "Hallo") +set(test2Value "Welt") + +set(tag1Found FALSE) +set(ref1Found FALSE) + +file(STRINGS "${csProjectFile}" lines) + +foreach(i 1 2) + set(testReference "${test${i}Reference}") + set(testTag "${test${i}Tag}") + set(testValue "${test${i}Value}") + foreach(line IN LISTS lines) + if(line MATCHES "^ *<(Project|)Reference .*>$") + set(validTag FALSE) + if(line MATCHES "^ *<(Project|)Reference .*\".*${testReference}.*\".*>$") + set(validTag TRUE) + message(STATUS "foo.csproj is using reference ${testReference}") + set(ref${i}Found TRUE) + endif() + endif() + if(line MATCHES "^ *<${testTag}>${testValue}</${testTag}>$") + if(validTag) + message(STATUS "foo.csproj reference ${testReference} has tag ${testTag}") + set(tag${i}Found TRUE) + else() + message(STATUS "tag ${testTag} found in wrong place!") + set(tag${i}Found FALSE) + endif() + endif() + endforeach() +endforeach() + +if(NOT tag1Found OR NOT ref1Found OR + NOT tag2Found OR NOT ref2Found) + set(RunCMake_TEST_FAILED "Custom reference XML tag not found.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake new file mode 100644 index 0000000..2af1756 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake @@ -0,0 +1,19 @@ +enable_language(CSharp) +add_library(foo foo.cs) +add_library(foo2 foo.cs) + +set(test1Reference "System") +set(test1Tag "Hello") +set(test1Value "World") + +set(test2Reference "foo2") +set(test2Tag "Hallo") +set(test2Value "Welt") + +target_link_libraries(foo foo2) + +set_target_properties(foo PROPERTIES + VS_DOTNET_REFERENCES "${test1Reference};Blubb" + VS_DOTNET_REFERENCEPROP_${test1Reference}_TAG_${test1Tag} ${test1Value} + VS_DOTNET_REFERENCEPROP_${test2Reference}_TAG_${test2Tag} ${test2Value} + ) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt new file mode 100644 index 0000000..4825d7a --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt @@ -0,0 +1,3 @@ + *Error when uploading file: .*/Configure.xml + *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) + *Problems when submitting via HTTP diff --git a/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stdout.txt b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stdout.txt new file mode 100644 index 0000000..3973872 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stdout.txt @@ -0,0 +1 @@ +Add HTTP Header: "Authorization: Bearer asdf" diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt new file mode 100644 index 0000000..706e1f5 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stderr.txt @@ -0,0 +1 @@ +Error in HttpRequest diff --git a/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt new file mode 100644 index 0000000..3973872 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/CDashUploadHeaders-stdout.txt @@ -0,0 +1 @@ +Add HTTP Header: "Authorization: Bearer asdf" diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index e104f8a..b5d90d2 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -25,6 +25,8 @@ run_ctest_submit(CDashUploadNone CDASH_UPLOAD) run_ctest_submit(CDashUploadMissingFile CDASH_UPLOAD bad-upload) run_ctest_submit(CDashUploadRetry CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo RETRY_COUNT 2 RETRY_DELAY 1 INTERNAL_TEST_CHECKSUM) run_ctest_submit(CDashSubmitQuiet QUIET) +run_ctest_submit(CDashSubmitHeaders HTTPHEADER "Authorization: Bearer asdf") +run_ctest_submit(CDashUploadHeaders CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE} CDASH_UPLOAD_TYPE foo HTTPHEADER "Authorization: Bearer asdf") function(run_ctest_CDashUploadFTP) set(CASE_DROP_METHOD ftp) diff --git a/Tests/RunCMake/execute_process/ExitValues-stdout.txt b/Tests/RunCMake/execute_process/ExitValues-stdout.txt new file mode 100644 index 0000000..3bcaf46 --- /dev/null +++ b/Tests/RunCMake/execute_process/ExitValues-stdout.txt @@ -0,0 +1,14 @@ +^-- 1 - 1 RESULT_VARIABLE: 0 +-- 1 - 2 RESULT_VARIABLE: [^0].* +-- 2 - 1 RESULT_VARIABLE: 0 +-- 2 - 1 RESULTS_VARIABLE: 0 +-- 2 - 2 RESULT_VARIABLE: [^0].* +-- 2 - 2 RESULTS_VARIABLE: [^0].* +-- 3 - 1 RESULTS_VARIABLE: 0 +-- 3 - 2 RESULTS_VARIABLE: [^0].* +-- 4 - 1 RESULT_VARIABLE: 0 +-- 4 - 1 RESULTS_VARIABLE: [^0].*;0;[^0].*;0;[^0].*;0 +-- 4 - 1 RESULTS_VARIABLE_LENGTH: 6 +-- 5 - 1 RESULT_VARIABLE: [^0].* +-- 5 - 1 RESULTS_VARIABLE: 0;0;[^0].* +-- 5 - 1 RESULTS_VARIABLE_LENGTH: 3$ diff --git a/Tests/RunCMake/execute_process/ExitValues.cmake b/Tests/RunCMake/execute_process/ExitValues.cmake new file mode 100644 index 0000000..d80a57b --- /dev/null +++ b/Tests/RunCMake/execute_process/ExitValues.cmake @@ -0,0 +1,120 @@ +#1st TEST RESULT_VARIABLE ONLY +execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit" + RESULT_VARIABLE r0 + ) +message(STATUS " 1 - 1 RESULT_VARIABLE: ${r0}") +if(NOT r0 EQUAL 0) + message(FATAL_ERROR "zero exit code expected") +endif() +execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + RESULT_VARIABLE r01 + ERROR_QUIET + ) +message(STATUS " 1 - 2 RESULT_VARIABLE: ${r01}") +if(r01 EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected") +endif() +#2nd TEST RESULT_VARIABLE and RESULTS_VARIABLE +execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit" + RESULT_VARIABLE r1 + RESULTS_VARIABLE r1s + ) +message(STATUS " 2 - 1 RESULT_VARIABLE: ${r1}") +message(STATUS " 2 - 1 RESULTS_VARIABLE: ${r1s}") +if(NOT r1 EQUAL 0 OR NOT r1s EQUAL 0) + message(FATAL_ERROR "zero exit code expected") +endif() +execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + RESULT_VARIABLE r11 + RESULTS_VARIABLE r11s + ERROR_QUIET + ) +message(STATUS " 2 - 2 RESULT_VARIABLE: ${r11}") +message(STATUS " 2 - 2 RESULTS_VARIABLE: ${r11s}") +if(r11 EQUAL 0 OR r11s EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected") +endif() +#3rd TEST RESULTS_VARIABLE +execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit" + RESULTS_VARIABLE r2s + ) +message(STATUS " 3 - 1 RESULTS_VARIABLE: ${r2s}") +if(NOT r2s EQUAL 0) + message(FATAL_ERROR "zero exit code expected") +endif() +execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + RESULTS_VARIABLE r21s + ERROR_QUIET + ) +message(STATUS " 3 - 2 RESULTS_VARIABLE: ${r21s}") +if(r21s EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected") +endif() +#4th TEST RESULT_VARIABLE and RESULTS_VARIABLE WITH MULTICOMMAND +execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + COMMAND ${EXIT_CODE_EXE} "zero_exit" + COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + COMMAND ${EXIT_CODE_EXE} "zero_exit" + COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + COMMAND ${EXIT_CODE_EXE} "zero_exit" + RESULT_VARIABLE r31 + RESULTS_VARIABLE r31s + OUTPUT_QUIET + ERROR_QUIET + ) +message(STATUS " 4 - 1 RESULT_VARIABLE: ${r31}") +message(STATUS " 4 - 1 RESULTS_VARIABLE: ${r31s}") +if(NOT r31 EQUAL 0) + message(FATAL_ERROR "zero exit code expected for last command") +endif() +list(LENGTH r31s r31sLen) +message(STATUS " 4 - 1 RESULTS_VARIABLE_LENGTH: ${r31sLen}") +if(NOT r31sLen EQUAL 6) + message(FATAL_ERROR "length of RESULTS_VARIABLE is not as expected") +else() + foreach(loop_var RANGE 5) + list(GET r31s ${loop_var} rsLocal) + math(EXPR isOdd "${loop_var} % 2") + if(isOdd) + if(NOT rsLocal EQUAL 0) + message(FATAL_ERROR "zero exit code expected") + endif() + else() + if(rsLocal EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected") + endif() + endif() + endforeach() +endif() +#5th TEST RESULT_VARIABLE and RESULTS_VARIABLE WITH MULTICOMMAND +execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit" + COMMAND ${EXIT_CODE_EXE} "zero_exit" + COMMAND ${EXIT_CODE_EXE} "non_zero_exit" + RESULT_VARIABLE r41 + RESULTS_VARIABLE r41s + OUTPUT_QUIET + ERROR_QUIET + ) +message(STATUS " 5 - 1 RESULT_VARIABLE: ${r41}") +message(STATUS " 5 - 1 RESULTS_VARIABLE: ${r41s}") +if(r41 EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected for last command") +endif() +list(LENGTH r41s r41sLen) +message(STATUS " 5 - 1 RESULTS_VARIABLE_LENGTH: ${r41sLen}") +if(NOT r31sLen EQUAL 6) + message(FATAL_ERROR "length of RESULTS_VARIABLE is not as expected") +else() + list(GET r41s 0 rsLocal) + if(NOT rsLocal EQUAL 0) + message(FATAL_ERROR "zero exit code expected") + endif() + list(GET r41s 1 rsLocal) + if(NOT rsLocal EQUAL 0) + message(FATAL_ERROR "zero exit code expected") + endif() + list(GET r41s 2 rsLocal) + if(rsLocal EQUAL 0) + message(FATAL_ERROR "non-zero exit code expected") + endif() +endif() diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index 62e18c6..83589bb 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -11,3 +11,7 @@ run_cmake(EncodingMissing) if(TEST_ENCODING_EXE) run_cmake_command(EncodingUTF8 ${CMAKE_COMMAND} -DTEST_ENCODING=UTF8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE} -P ${RunCMake_SOURCE_DIR}/Encoding.cmake) endif() + +if(EXIT_CODE_EXE) + run_cmake_command(ExitValues ${CMAKE_COMMAND} -DEXIT_CODE_EXE=${EXIT_CODE_EXE} -P ${RunCMake_SOURCE_DIR}/ExitValues.cmake) +endif() diff --git a/Tests/RunCMake/exit_code.c b/Tests/RunCMake/exit_code.c new file mode 100644 index 0000000..3eba019 --- /dev/null +++ b/Tests/RunCMake/exit_code.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +// Usage: +// +// /path/to/program arg1 [arg2 [...]] +// +// Return EXIT_SUCCESS if 'zero_exit' +// string was found in <arg1>. +// Return EXIT_FAILURE if 'non_zero_exit' +// string was found in <arg1>. + +int main(int argc, const char* argv[]) +{ + const char* substring_failure = "non_zero_exit"; + const char* substring_success = "zero_exit"; + const char* str = argv[1]; + if (argc < 2) { + return EXIT_FAILURE; + } + if (strcmp(str, substring_success) == 0) { + return EXIT_SUCCESS; + } else if (strcmp(str, substring_failure) == 0) { + return EXIT_FAILURE; + } + fprintf(stderr, "Failed to find string '%s' in '%s'\n", substring_success, + str); + return EXIT_FAILURE; +} diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt index 04d09f2..12cd3c7 100644 --- a/Tests/RunCMake/find_dependency/CMakeLists.txt +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) -set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt deleted file mode 100644 index 348f8bb..0000000 --- a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency. EXACT may only be specified if a - VERSION is specified -Call Stack \(most recent call first\): - EXACT-no-version.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version.cmake b/Tests/RunCMake/find_dependency/EXACT-no-version.cmake deleted file mode 100644 index b05665b7..0000000 --- a/Tests/RunCMake/find_dependency/EXACT-no-version.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 EXACT) diff --git a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake index 9403136..a72d189 100644 --- a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake @@ -1,7 +1,10 @@ include(RunCMake) -run_cmake(EXACT-no-version) -run_cmake(empty-version) -run_cmake(empty-arg-3) -run_cmake(invalid-arg-3) -run_cmake(extra-args) +# Success tests +run_cmake(realistic) +run_cmake(basic) + +# Failure tests +run_cmake(invalid-arg) +run_cmake(bad-version-fuzzy) +run_cmake(bad-version-exact) diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt b/Tests/RunCMake/find_dependency/bad-version-exact-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt +++ b/Tests/RunCMake/find_dependency/bad-version-exact-result.txt diff --git a/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt b/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt new file mode 100644 index 0000000..0929f84 --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-exact-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "Pack1" that exactly + matches requested version "1.1". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake, version: 1.3 + +Call Stack \(most recent call first\): + bad-version-exact.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/bad-version-exact.cmake b/Tests/RunCMake/find_dependency/bad-version-exact.cmake new file mode 100644 index 0000000..c4ca5e2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-exact.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.1 EXACT REQUIRED) diff --git a/Tests/RunCMake/find_dependency/extra-args-result.txt b/Tests/RunCMake/find_dependency/bad-version-fuzzy-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/extra-args-result.txt +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy-result.txt diff --git a/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt b/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt new file mode 100644 index 0000000..c63256f --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + Could not find a configuration file for package "Pack1" that is compatible + with requested version "1.4". + + The following configuration files were considered but not accepted: + + .*/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake, version: 1.3 + +Call Stack \(most recent call first\): + bad-version-fuzzy.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake b/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake new file mode 100644 index 0000000..c7cf4ee --- /dev/null +++ b/Tests/RunCMake/find_dependency/bad-version-fuzzy.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.4 REQUIRED) diff --git a/Tests/RunCMake/find_dependency/basic.cmake b/Tests/RunCMake/find_dependency/basic.cmake new file mode 100644 index 0000000..c7795f2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/basic.cmake @@ -0,0 +1,5 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.1) diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-result.txt b/Tests/RunCMake/find_dependency/empty-arg-3-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/find_dependency/empty-arg-3-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt deleted file mode 100644 index bf9b02b..0000000 --- a/Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - empty-arg-3.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/empty-arg-3.cmake b/Tests/RunCMake/find_dependency/empty-arg-3.cmake deleted file mode 100644 index b08200a..0000000 --- a/Tests/RunCMake/find_dependency/empty-arg-3.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 1.2 "") diff --git a/Tests/RunCMake/find_dependency/empty-version-stderr.txt b/Tests/RunCMake/find_dependency/empty-version-stderr.txt deleted file mode 100644 index b5e9f46..0000000 --- a/Tests/RunCMake/find_dependency/empty-version-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency. VERSION is empty -Call Stack \(most recent call first\): - empty-version.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/empty-version.cmake b/Tests/RunCMake/find_dependency/empty-version.cmake deleted file mode 100644 index e6f17cd..0000000 --- a/Tests/RunCMake/find_dependency/empty-version.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 "") diff --git a/Tests/RunCMake/find_dependency/extra-args-stderr.txt b/Tests/RunCMake/find_dependency/extra-args-stderr.txt deleted file mode 100644 index 83a7f02..0000000 --- a/Tests/RunCMake/find_dependency/extra-args-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - extra-args.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/extra-args.cmake b/Tests/RunCMake/find_dependency/extra-args.cmake deleted file mode 100644 index 209645a..0000000 --- a/Tests/RunCMake/find_dependency/extra-args.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -include(CMakeFindDependencyMacro) - -find_dependency(Pack1 1.2 EXACT PATHS "${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt deleted file mode 100644 index fee8d5d..0000000 --- a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\): - Invalid arguments to find_dependency -Call Stack \(most recent call first\): - invalid-arg-3.cmake:4 \(find_dependency\) - CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/empty-version-result.txt b/Tests/RunCMake/find_dependency/invalid-arg-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/find_dependency/empty-version-result.txt +++ b/Tests/RunCMake/find_dependency/invalid-arg-result.txt diff --git a/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt new file mode 100644 index 0000000..16077b2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(find_package\): + find_package called with invalid argument "EXACTYPO" +Call Stack \(most recent call first\): + invalid-arg.cmake:5 \(find_dependency\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3.cmake b/Tests/RunCMake/find_dependency/invalid-arg.cmake index 40ede07..daaf569 100644 --- a/Tests/RunCMake/find_dependency/invalid-arg-3.cmake +++ b/Tests/RunCMake/find_dependency/invalid-arg.cmake @@ -1,3 +1,4 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include(CMakeFindDependencyMacro) diff --git a/Tests/RunCMake/find_dependency/realistic.cmake b/Tests/RunCMake/find_dependency/realistic.cmake new file mode 100644 index 0000000..e633a31 --- /dev/null +++ b/Tests/RunCMake/find_dependency/realistic.cmake @@ -0,0 +1,3 @@ +set(Pack2_DIR "${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/Pack2") + +find_package(Pack2 1.2 REQUIRED) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake index 7d55ef6..7d55ef6 100644 --- a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1Config.cmake diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1ConfigVersion.cmake index dfb7b6c..dfb7b6c 100644 --- a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack1/Pack1ConfigVersion.cmake diff --git a/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake new file mode 100644 index 0000000..7e8a60b --- /dev/null +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2Config.cmake @@ -0,0 +1,6 @@ +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 PATHS ${CMAKE_CURRENT_LIST_DIR}/..) + +add_library(Pack2::Lib INTERFACE IMPORTED) +set_target_properties(Pack2::Lib PROPERTIES INTERFACE_LINK_LIBRARIES Pack1::Lib) diff --git a/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake new file mode 100644 index 0000000..dfb7b6c --- /dev/null +++ b/Tests/RunCMake/find_dependency/share/cmake/Pack2/Pack2ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "1.3") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/find_package/MissingConfig-stderr.txt b/Tests/RunCMake/find_package/MissingConfig-stderr.txt index 1eae0bb..33ff545 100644 --- a/Tests/RunCMake/find_package/MissingConfig-stderr.txt +++ b/Tests/RunCMake/find_package/MissingConfig-stderr.txt @@ -1,18 +1,3 @@ -CMake Warning at MissingConfig.cmake:1 \(find_package\): - Could not find a package configuration file provided by "NotHere" with any - of the following names: - - NotHereConfig.cmake - nothere-config.cmake - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) - - CMake Warning at MissingConfig.cmake:2 \(message\): This warning must be reachable. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/find_package/MissingConfig-stdout.txt b/Tests/RunCMake/find_package/MissingConfig-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfig-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt b/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigNormal-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt b/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt deleted file mode 100644 index 10e71fa..0000000 --- a/Tests/RunCMake/find_package/MissingConfigOneName-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -CMake Warning at MissingConfigOneName.cmake:1 \(find_package\): - Could not find a package configuration file named "NotHereConfig.cmake" - provided by package "NotHere". - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt b/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigOneName-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt b/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt deleted file mode 100644 index 2f5086e..0000000 --- a/Tests/RunCMake/find_package/MissingConfigVersion-stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -CMake Warning at MissingConfigVersion.cmake:1 \(find_package\): - Could not find a package configuration file provided by "NotHere" - \(requested version 1\.2\) with any of the following names: - - NotHereConfig.cmake - nothere-config.cmake - - Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set - "NotHere_DIR" to a directory containing one of the above files. If - "NotHere" provides a separate development package or SDK, be sure it has - been installed. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt b/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt new file mode 100644 index 0000000..7af632b --- /dev/null +++ b/Tests/RunCMake/find_package/MissingConfigVersion-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find NotHere \(missing: NotHere_DIR\) diff --git a/Tests/RunCMake/find_package/PackageRoot-stderr.txt b/Tests/RunCMake/find_package/PackageRoot-stderr.txt new file mode 100644 index 0000000..07b27bd --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot-stderr.txt @@ -0,0 +1,319 @@ +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :BAR_TEST_PATH_BAR-NOTFOUND +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND + +Foo_ROOT : +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND +FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND +FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND +BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT : +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} : +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe + +Foo_ROOT : +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe + +Foo_ROOT :.*/PackageRoot/foo/cmake_root +ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Bar_ROOT :.*/PackageRoot/bar/cmake_root +ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h +BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include +BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include +BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake new file mode 100644 index 0000000..d9f41f8 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot.cmake @@ -0,0 +1,143 @@ +cmake_policy(SET CMP0057 NEW) +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) +set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) + +macro(CleanUpPackageRootTest) + unset(Foo_ROOT) + unset(ENV{Foo_ROOT}) + unset(Bar_ROOT) + unset(ENV{Bar_ROOT}) + unset(FOO_TEST_FILE_FOO) + unset(FOO_TEST_PATH_FOO) + unset(FOO_TEST_PROG_FOO) + unset(BAR_TEST_FILE_FOO) + unset(BAR_TEST_FILE_BAR) + unset(BAR_TEST_PATH_FOO) + unset(BAR_TEST_PATH_BAR) + unset(BAR_TEST_PROG_FOO) + unset(BAR_TEST_PROG_BAR) + unset(FOO_TEST_FILE_FOO CACHE) + unset(FOO_TEST_PATH_FOO CACHE) + unset(FOO_TEST_PROG_FOO CACHE) + unset(BAR_TEST_FILE_FOO CACHE) + unset(BAR_TEST_FILE_BAR CACHE) + unset(BAR_TEST_PATH_FOO CACHE) + unset(BAR_TEST_PATH_BAR CACHE) + unset(BAR_TEST_PROG_FOO CACHE) + unset(BAR_TEST_PROG_BAR CACHE) +endmacro() + +macro(RunPackageRootTest) + set(orig_foo_cmake_root ${Foo_ROOT}) + set(orig_foo_env_root $ENV{Foo_ROOT}) + set(orig_bar_cmake_root ${Bar_ROOT}) + set(orig_bar_env_root $ENV{Bar_ROOT}) + + find_package(Foo) + message("Foo_ROOT :${Foo_ROOT}") + message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") + message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") + message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") + message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") + CleanUpPackageRootTest() + message("") + + set(Foo_ROOT ${orig_foo_cmake_root}) + set(ENV{Foo_ROOT} ${orig_foo_env_root}) + set(Bar_ROOT ${orig_bar_cmake_root}) + set(ENV{Bar_ROOT} ${orig_bar_env_root}) + + find_package(Foo COMPONENTS Bar) + message("Foo_ROOT :${Foo_ROOT}") + message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") + message("Bar_ROOT :${Bar_ROOT}") + message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}") + message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") + message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") + message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") + message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}") + message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}") + message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}") + message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}") + message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}") + message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}") + CleanUpPackageRootTest() + message("") + + unset(orig_foo_cmake_root) + unset(orig_foo_env_root) + unset(orig_bar_cmake_root) + unset(orig_bar_env_root) +endmacro() + +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +RunPackageRootTest() + +## + +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +## + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() + +set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root) +set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root) +set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root) +set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root) +RunPackageRootTest() diff --git a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake new file mode 100644 index 0000000..eefa49c --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake @@ -0,0 +1,6 @@ +find_file(BAR_TEST_FILE_FOO foo.h) +find_file(BAR_TEST_FILE_BAR bar.h) +find_path(BAR_TEST_PATH_FOO foo.h) +find_path(BAR_TEST_PATH_BAR bar.h) +find_program(BAR_TEST_PROG_FOO foo.exe) +find_program(BAR_TEST_PROG_BAR bar.exe) diff --git a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake new file mode 100644 index 0000000..cb62390 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake @@ -0,0 +1,7 @@ +find_file(FOO_TEST_FILE_FOO foo.h) +find_path(FOO_TEST_PATH_FOO foo.h) +find_program(FOO_TEST_PROG_FOO foo.exe) + +if ("Bar" IN_LIST Foo_FIND_COMPONENTS) + find_package(Bar) +endif () diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/bin/foo.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/foo.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/bin/foo.exe diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/bar.h diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/foo.h diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 81b2906..72f9c4d 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -13,6 +13,7 @@ run_cmake(MissingConfigOneName) run_cmake(MissingConfigRequired) run_cmake(MissingConfigVersion) run_cmake(MixedModeOptions) +run_cmake(PackageRoot) run_cmake(PolicyPush) run_cmake(PolicyPop) run_cmake(SetFoundFALSE) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt deleted file mode 100644 index 695f645..0000000 --- a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt +++ /dev/null @@ -1,9 +0,0 @@ -CMake Warning at SetFoundFALSE.cmake:2 \(find_package\): - Found package configuration file: - - .*/Tests/RunCMake/find_package/SetFoundFALSEConfig.cmake - - but it set SetFoundFALSE_FOUND to FALSE so package "SetFoundFALSE" is - considered to be NOT FOUND. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt new file mode 100644 index 0000000..37e6e7e --- /dev/null +++ b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find SetFoundFALSE \(missing: SetFoundFALSE_DIR\) diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py index d11431d..78450d5 100644 --- a/Tests/Server/cmakelib.py +++ b/Tests/Server/cmakelib.py @@ -1,3 +1,4 @@ +from __future__ import print_function import sys, subprocess, json termwidth = 150 @@ -13,8 +14,8 @@ def ordered(obj): return obj def col_print(title, array): - print - print + print() + print() print(title) indentwidth = 4 diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py index 14767f4..62d9008 100644 --- a/Tests/Server/server-test.py +++ b/Tests/Server/server-test.py @@ -1,3 +1,4 @@ +from __future__ import print_function import sys, cmakelib, json, os, shutil debug = True diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt index 9289e84..4e4a030 100644 --- a/Tests/SourceGroups/CMakeLists.txt +++ b/Tests/SourceGroups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.8) project(SourceGroups) # this is not really a test which can fail @@ -33,10 +33,11 @@ source_group(EmptyGroup) set(root ${CMAKE_CURRENT_SOURCE_DIR}) set(tree_files_without_prefix ${root}/sub1/tree_bar.c - ${root}/sub1/tree_baz.c - ${root}/sub1/tree_subdir/tree_foobar.c) + sub1/tree_baz.c + sub1/../sub1/tree_subdir/tree_foobar.c) -set(tree_files_with_prefix ${root}/tree_foo.c) +set(tree_files_with_prefix ${root}/tree_prefix_foo.c + tree_prefix_bar.c) source_group(TREE ${root} FILES ${tree_files_without_prefix}) diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c index b88f2f8..4d84cf2 100644 --- a/Tests/SourceGroups/main.c +++ b/Tests/SourceGroups/main.c @@ -5,7 +5,8 @@ extern int bar(void); extern int foobar(void); extern int barbar(void); extern int baz(void); -extern int tree_foo(void); +extern int tree_prefix_foo(void); +extern int tree_prefix_bar(void); extern int tree_bar(void); extern int tree_foobar(void); extern int tree_baz(void); @@ -15,7 +16,9 @@ int main() printf("foo: %d bar: %d foobar: %d barbar: %d baz: %d\n", foo(), bar(), foobar(), barbar(), baz()); - printf("tree_foo: %d tree_bar: %d tree_foobar: %d tree_baz: %d\n", - tree_foo(), tree_bar(), tree_foobar(), tree_baz()); + printf("tree_prefix_foo: %d tree_prefix_bar: %d tree_bar: %d tree_foobar: " + "%d tree_baz: %d\n", + tree_prefix_foo(), tree_prefix_bar(), tree_bar(), tree_foobar(), + tree_baz()); return 0; } diff --git a/Tests/SourceGroups/tree_foo.c b/Tests/SourceGroups/tree_foo.c deleted file mode 100644 index d392e41..0000000 --- a/Tests/SourceGroups/tree_foo.c +++ /dev/null @@ -1,4 +0,0 @@ -int tree_foo(void) -{ - return 6; -} diff --git a/Tests/SourceGroups/tree_prefix_bar.c b/Tests/SourceGroups/tree_prefix_bar.c new file mode 100644 index 0000000..bd98476 --- /dev/null +++ b/Tests/SourceGroups/tree_prefix_bar.c @@ -0,0 +1,4 @@ +int tree_prefix_bar(void) +{ + return 66; +} diff --git a/Tests/SourceGroups/tree_prefix_foo.c b/Tests/SourceGroups/tree_prefix_foo.c new file mode 100644 index 0000000..92c2fd7 --- /dev/null +++ b/Tests/SourceGroups/tree_prefix_foo.c @@ -0,0 +1,4 @@ +int tree_prefix_foo(void) +{ + return 6; +} diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index 3f56303..718e624 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -18,9 +18,8 @@ if(CMAKE_RC_COMPILER MATCHES windres) message(STATUS "CMAKE_RC_COMPILER MATCHES windres") add_definitions(/DCMAKE_RCDEFINE=test.txt) add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS) - if(MSYS AND CMAKE_CURRENT_BINARY_DIR MATCHES " ") - # windres cannot handle spaces in include dir, and - # for the MSys shell we do not convert to shortpath. + if(CMAKE_CURRENT_BINARY_DIR MATCHES " ") + # windres cannot handle spaces in include dir set(CMAKE_RC_NO_INCLUDE 1) endif() elseif(MSVC60) diff --git a/Tests/Wrapping/fakefluid.cxx b/Tests/Wrapping/fakefluid.cxx index 02c0c52..a118bbd 100644 --- a/Tests/Wrapping/fakefluid.cxx +++ b/Tests/Wrapping/fakefluid.cxx @@ -6,7 +6,9 @@ int main(int ac, char** av) if (strcmp(av[i], "-o") == 0 || strcmp(av[i], "-h") == 0) { fprintf(stdout, "fakefluid is creating file \"%s\"\n", av[i + 1]); FILE* file = fopen(av[i + 1], "w"); - fprintf(file, "// hello\n"); + fprintf(file, "// Solaris needs non-empty content so ensure\n" + "// we have at least one symbol\n" + "int Solaris_requires_a_symbol_here = 0;\n"); fclose(file); } } |