summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_file/FromPrefixPath.cmake
blob: 63c6a079155e3ba747cb3ae6c1d72c09b57ea14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
set(ENV_PATH "$ENV{PATH}")
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)
set(ENV{PATH} "${ENV_PATH}")