summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_path
diff options
context:
space:
mode:
authorJohn Parent <john.parent@kitware.com>2021-12-07 19:43:30 (GMT)
committerBrad King <brad.king@kitware.com>2021-12-17 13:55:21 (GMT)
commitd7b18895bcc707ed58beed9e17434341e60a6060 (patch)
tree9c4dfc589a843668d2d642a864f7002060a6822f /Tests/RunCMake/find_path
parent029c8f50652415baf4aa3dd96c9a8dc9626ae4ec (diff)
downloadCMake-d7b18895bcc707ed58beed9e17434341e60a6060.zip
CMake-d7b18895bcc707ed58beed9e17434341e60a6060.tar.gz
CMake-d7b18895bcc707ed58beed9e17434341e60a6060.tar.bz2
cmake: Add filtered debug-find options
Add a `--debug-find-pkg=` option to debug find calls for specific packages. Add a `--debug-find-var=` option to debug find calls for specific return variables. Fixes: #21880
Diffstat (limited to 'Tests/RunCMake/find_path')
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar-stderr.txt27
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-cygwin.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-msys.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-windows.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnvDebugVar.cmake35
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake2
7 files changed, 100 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stderr.txt b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stderr.txt
new file mode 100644
index 0000000..088efd5
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stderr.txt
@@ -0,0 +1,27 @@
+ find_path called with the following settings:.*
+ VAR: PATH_IN_ENV_PATH
+ NAMES: \"PrefixInPATH\.h\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_path considered the following locations:.*
+ The item was not found.*
+ find_path called with the following settings:.*
+ VAR: PATH_IN_ENV_PATH
+ NAMES: \"PrefixInPATH\.h\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_path considered the following locations:.*
+ The item was found at.*
+.*include/PrefixInPATH.*
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-cygwin.txt b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-cygwin.txt
new file mode 100644
index 0000000..a502d78
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-cygwin.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-msys.txt b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-msys.txt
new file mode 100644
index 0000000..a502d78
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-msys.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-windows.txt b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-windows.txt
new file mode 100644
index 0000000..a502d78
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout-windows.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout.txt b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout.txt
new file mode 100644
index 0000000..0d2389d
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar-stdout.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH_A-NOTFOUND'
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
+-- PATH_IN_ENV_PATH=''
diff --git a/Tests/RunCMake/find_path/FromPATHEnvDebugVar.cmake b/Tests/RunCMake/find_path/FromPATHEnvDebugVar.cmake
new file mode 100644
index 0000000..4c83151
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnvDebugVar.cmake
@@ -0,0 +1,35 @@
+set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/include")
+find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+
+
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH_A CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PATH_A NAMES PrefixInPATH.h)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH_A}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH_A CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PATH_A NAMES PrefixInPATH.h)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH_A}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH_A CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PAT_H_A NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH_A}'")
+endforeach()
+
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index 90ee768..5b52f90 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -9,3 +9,5 @@ run_cmake(NO_CACHE)
if(APPLE)
run_cmake(FrameworksWithSubdirs)
endif()
+
+run_cmake_with_options(FromPATHEnvDebugVar --debug-find-var=PATH_IN_ENV_PATH)