summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FPHSA/FindCustomMessage.cmake
blob: 4d67db86da94fc4e084bfc820b254edf13fa544d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# pseudo find_module

if (REASON_FAILURE_MESSAGE)
  list (PREPEND REASON_FAILURE_MESSAGE "REASON_FAILURE_MESSAGE")
endif()

include(FindPackageHandleStandardArgs)

if (CONFIG_MODE)
  find_package (CustomMessage QUIET CONFIG HINTS "${CMAKE_MODULE_PATH}")
  find_package_handle_standard_args(CustomMessage CONFIG_MODE
                                                  ${REASON_FAILURE_MESSAGE})
else()
  find_package_handle_standard_args(CustomMessage REQUIRED_VARS FOOBAR
                                                  VERSION_VAR CustomMessage_VERSION
                                                  ${REASON_FAILURE_MESSAGE})
endif()