summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_program/EnvAndHints.cmake
blob: 0f12effc062b9bb05149354701319bed98b79d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

set(ENV_PATH "$ENV{PATH}")
set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
find_program(PROG
  NAMES testAandB
  )
message(STATUS "PROG='${PROG}'")
unset(PROG CACHE)

set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
find_program(PROG
  NAMES testAandB
  )
message(STATUS "PROG='${PROG}'")
unset(PROG CACHE)

find_program(PROG
  NAMES testAandB
  HINTS ${CMAKE_CURRENT_SOURCE_DIR}/B ${CMAKE_CURRENT_SOURCE_DIR}/A
  )
message(STATUS "PROG='${PROG}'")
unset(PROG CACHE)
set(ENV{PATH} "${ENV_PATH}")

find_program(PROG
  NAMES testAandB
  HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
  )
message(STATUS "PROG='${PROG}'")
unset(PROG CACHE)
set(ENV{PATH} "${ENV_PATH}")