diff options
Diffstat (limited to 'Tests/RunCMake')
22 files changed, 487 insertions, 3 deletions
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/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 752ce8a..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") 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/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) |