summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_file/FromPrefixPath.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-06-12 20:04:22 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-21 15:06:39 (GMT)
commit02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f (patch)
tree91222ea7bb0386155dd7a4f673bf1164918ed5ea /Tests/RunCMake/find_file/FromPrefixPath.cmake
parentf0a89149bc569020e281c5908733bf4b7eeddf15 (diff)
downloadCMake-02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f.zip
CMake-02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f.tar.gz
CMake-02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f.tar.bz2
Find: Provide global controls for the `NO_[]_PATH` call options
Diffstat (limited to 'Tests/RunCMake/find_file/FromPrefixPath.cmake')
-rw-r--r--Tests/RunCMake/find_file/FromPrefixPath.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/FromPrefixPath.cmake b/Tests/RunCMake/find_file/FromPrefixPath.cmake
new file mode 100644
index 0000000..1bf8409
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPrefixPath.cmake
@@ -0,0 +1,17 @@
+set(ENV{PATH} "")
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_PREFIX_PATH )
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)