summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyedwards@nvidia.com>2024-08-02 20:18:44 (GMT)
committerKyle Edwards <kyedwards@nvidia.com>2024-08-02 20:18:44 (GMT)
commitf8264cf2ffc3daabffe25365a5e91865d97d147b (patch)
tree96055e7632a93148205b81512f071d5fc2b1b08e /Tests
parent289c30ad3ab31dbdc5348bf5450344f6ec08ceca (diff)
downloadCMake-f8264cf2ffc3daabffe25365a5e91865d97d147b.zip
CMake-f8264cf2ffc3daabffe25365a5e91865d97d147b.tar.gz
CMake-f8264cf2ffc3daabffe25365a5e91865d97d147b.tar.bz2
find_package(): Debug re-rooting behavior
find_package()'s debug mode provides information about which prefixes are searched, but not which roots are prepended to each prefix. Display this information if debugging is enabled.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/find_package/DebugRoot-stderr.txt52
-rw-r--r--Tests/RunCMake/find_package/DebugRoot.cmake15
-rw-r--r--Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig.cmake1
-rw-r--r--Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/.empty0
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake1
5 files changed, 69 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/DebugRoot-stderr.txt b/Tests/RunCMake/find_package/DebugRoot-stderr.txt
new file mode 100644
index 0000000..00a70c1
--- /dev/null
+++ b/Tests/RunCMake/find_package/DebugRoot-stderr.txt
@@ -0,0 +1,52 @@
+^CMake Debug Log at DebugRoot\.cmake:[0-9]+ \(find_package\):
+ The internally managed CMAKE_FIND_PACKAGE_REDIRECTS_DIR\.
+
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot-build/CMakeFiles/pkgRedirects
+
+ Paths specified by the find_package HINTS option\.
+
+ none
+
+ Paths specified by the find_package PATHS option\.
+
+ /DebugRoot
+
+ Prepending the following roots to each prefix:
+
+ CMAKE_FIND_ROOT_PATH
+
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/NoExist
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/Exist
+
+ CMAKE_SYSROOT_COMPILE
+
+ none
+
+ CMAKE_SYSROOT_LINK
+
+ none
+
+ CMAKE_SYSROOT
+
+ none
+
+ find_package considered the following locations for DebugRoot's Config
+ module:
+
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/DebugRootConfig\.cmake
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/debugroot-config\.cmake
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig\.cmake
+
+ The file was found at
+
+ [^
+]*/Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig.cmake
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/DebugRoot.cmake b/Tests/RunCMake/find_package/DebugRoot.cmake
new file mode 100644
index 0000000..2fb7017
--- /dev/null
+++ b/Tests/RunCMake/find_package/DebugRoot.cmake
@@ -0,0 +1,15 @@
+set(CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}/DebugRoot/NoExist ${CMAKE_CURRENT_LIST_DIR}/DebugRoot/Exist)
+set(CMAKE_FIND_DEBUG_MODE ON)
+find_package(DebugRoot
+ NO_DEFAULT_PATH
+ NO_PACKAGE_ROOT_PATH
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_PACKAGE_REGISTRY
+ NO_CMAKE_SYSTEM_PATH
+ NO_CMAKE_INSTALL_PREFIX
+ NO_CMAKE_SYSTEM_PACKAGE_REGISTRY
+ PATHS /DebugRoot
+ )
+set(CMAKE_FIND_DEBUG_MODE OFF)
diff --git a/Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig.cmake b/Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig.cmake
new file mode 100644
index 0000000..683b7a6
--- /dev/null
+++ b/Tests/RunCMake/find_package/DebugRoot/Exist/DebugRoot/DebugRootConfig.cmake
@@ -0,0 +1 @@
+set(DebugRoot_FOUND TRUE)
diff --git a/Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/.empty b/Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/DebugRoot/NoExist/DebugRoot/.empty
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 8cda4c1..1995ac4 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -74,6 +74,7 @@ run_cmake(IgnorePrefixPath)
run_cmake(REGISTRY_VIEW-no-view)
run_cmake(REGISTRY_VIEW-wrong-view)
run_cmake(REGISTRY_VIEW-propagated)
+run_cmake(DebugRoot)
if(CMAKE_HOST_WIN32 AND MINGW)
run_cmake(MSYSTEM_PREFIX)