summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake
blob: ee40d88b59540b8c8539ccb966395f044fd7a0c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

find_package(Bar QUIET CONFIG NO_CMAKE_INSTALL_PREFIX)
if(Bar_FOUND)
  message(SEND_ERROR "Bar should not be found, was found in ${Bar_DIR}")
endif()

set(CMAKE_FIND_USE_INSTALL_PREFIX OFF)
find_package(Bar QUIET CONFIG)
if(Bar_FOUND)
  message(SEND_ERROR "Bar should not be found, was found in ${Bar_DIR}")
endif()

set(CMAKE_FIND_USE_INSTALL_PREFIX ON)
find_package(Bar QUIET CONFIG)
if(NOT Bar_FOUND)
  message(SEND_ERROR "Bar should be found via CMAKE_INSTALL_PREFIX")
endif()