summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_file/PrefixInPATH.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-20 13:10:50 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-02-20 13:10:50 (GMT)
commitc4c570f9cc7a7c5f22670793af887dfa5a6dd7de (patch)
treeb0a30a923a61649f06212320de0929bb5803d3ae /Tests/RunCMake/find_file/PrefixInPATH.cmake
parentb7351d8e14ea7cc05b0c5d45dae48a21aef298c1 (diff)
parentffc06c12397e7cda7307afcfc8a79ebda4a786a6 (diff)
downloadCMake-c4c570f9cc7a7c5f22670793af887dfa5a6dd7de.zip
CMake-c4c570f9cc7a7c5f22670793af887dfa5a6dd7de.tar.gz
CMake-c4c570f9cc7a7c5f22670793af887dfa5a6dd7de.tar.bz2
Merge topic 'find-command-prefix-from-PATH'
ffc06c12 Teach find_(library|file|path) to get prefixes from PATH (#15370)
Diffstat (limited to 'Tests/RunCMake/find_file/PrefixInPATH.cmake')
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/PrefixInPATH.cmake b/Tests/RunCMake/find_file/PrefixInPATH.cmake
new file mode 100644
index 0000000..1e33c08
--- /dev/null
+++ b/Tests/RunCMake/find_file/PrefixInPATH.cmake
@@ -0,0 +1,8 @@
+set(ENV_PATH "$ENV{PATH}")
+foreach(path "/does_not_exist" "" "/bin" "/sbin")
+ unset(PrefixInPATH_INCLUDE_DIR CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_INCLUDE_DIR NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_INCLUDE_DIR='${PrefixInPATH_INCLUDE_DIR}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")