summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-08 11:59:52 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-08 12:23:57 (GMT)
commite574bce15b4063a92ca213b20f31532d45704619 (patch)
tree4a3d5684cd6fb3b99a0ef24b933e98603370b2e0 /Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
parent4a207116908c20caba4969120b1148adff391348 (diff)
downloadCMake-e574bce15b4063a92ca213b20f31532d45704619.zip
CMake-e574bce15b4063a92ca213b20f31532d45704619.tar.gz
CMake-e574bce15b4063a92ca213b20f31532d45704619.tar.bz2
Tests: Simplify RunCMake.find_package PackageRoot case regexes
Diffstat (limited to 'Tests/RunCMake/find_package/PackageRootNestedConfig.cmake')
-rw-r--r--Tests/RunCMake/find_package/PackageRootNestedConfig.cmake43
1 files changed, 24 insertions, 19 deletions
diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
index 571739d..321d1fc 100644
--- a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
+++ b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
@@ -2,6 +2,11 @@ cmake_policy(SET CMP0057 NEW)
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
+function(PrintPath label path)
+ string(REPLACE "${PackageRoot_BASE}" "<base>" out "${path}")
+ message("${label}${out}")
+endfunction()
+
macro(CleanUpPackageRootTest)
unset(Foo_ROOT)
unset(ENV{Foo_ROOT})
@@ -41,29 +46,29 @@ endmacro()
macro(RunPackageRootTest)
message("----------")
- message("Foo_ROOT :${Foo_ROOT}")
- message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}")
- message("Bar_DIR :${Bar_DIR}")
- message("Bar_ROOT :${Bar_ROOT}")
- message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}")
+ PrintPath("Foo_ROOT :" "${Foo_ROOT}")
+ PrintPath("ENV{Foo_ROOT} :" "$ENV{Foo_ROOT}")
+ PrintPath("Bar_DIR :" "${Bar_DIR}")
+ PrintPath("Bar_ROOT :" "${Bar_ROOT}")
+ PrintPath("ENV{Bar_ROOT} :" "$ENV{Bar_ROOT}")
message("")
find_package(Foo COMPONENTS BarConfig)
message("find_package(Foo COMPONENTS BarConfig)")
- message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}")
- message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}")
- message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}")
- message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}")
- message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}")
- message("BAR_CMAKE_FILE :${BAR_CMAKE_FILE}")
- message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}")
- message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}")
- message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}")
- message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}")
- message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}")
- message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}")
- message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}")
- message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}")
+ PrintPath("FOO_TEST_FILE_FOO :" "${FOO_TEST_FILE_FOO}")
+ PrintPath("FOO_TEST_FILE_ZOT :" "${FOO_TEST_FILE_ZOT}")
+ PrintPath("FOO_TEST_PATH_FOO :" "${FOO_TEST_PATH_FOO}")
+ PrintPath("FOO_TEST_PATH_ZOT :" "${FOO_TEST_PATH_ZOT}")
+ PrintPath("FOO_TEST_PROG_FOO :" "${FOO_TEST_PROG_FOO}")
+ PrintPath("BAR_CMAKE_FILE :" "${BAR_CMAKE_FILE}")
+ PrintPath("BAR_TEST_FILE_FOO :" "${BAR_TEST_FILE_FOO}")
+ PrintPath("BAR_TEST_FILE_BAR :" "${BAR_TEST_FILE_BAR}")
+ PrintPath("BAR_TEST_FILE_ZOT :" "${BAR_TEST_FILE_ZOT}")
+ PrintPath("BAR_TEST_PATH_FOO :" "${BAR_TEST_PATH_FOO}")
+ PrintPath("BAR_TEST_PATH_BAR :" "${BAR_TEST_PATH_BAR}")
+ PrintPath("BAR_TEST_PATH_ZOT :" "${BAR_TEST_PATH_ZOT}")
+ PrintPath("BAR_TEST_PROG_FOO :" "${BAR_TEST_PROG_FOO}")
+ PrintPath("BAR_TEST_PROG_BAR :" "${BAR_TEST_PROG_BAR}")
CleanUpPackageRootTest()
message("")
endmacro()