summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_library/VALIDATOR.cmake
blob: 759394128773dc273a8c20838eb16ea1110acba0 (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
32
33
34
35
36
37
38
39
40
41
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)

function(CHECK_DEFAULT result filename)
  message("CHECK='${filename}'")
endfunction()

function(CHECK_OK result filename)
  message("CHECK='${filename}'")
  set(${result} TRUE PARENT_SCOPE)
endfunction()

function(CHECK_KO result filename)
  message("CHECK='${filename}'")
  set(${result} FALSE PARENT_SCOPE)
endfunction()


find_library(LIB
  NAMES PrefixInPATH
  HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib
  VALIDATOR check_default
  )
message(STATUS "LIB='${LIB}'")
unset(LIB CACHE)

find_library(LIB
  NAMES PrefixInPATH
  HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib
  VALIDATOR check_ok
  )
message(STATUS "LIB='${LIB}'")
unset(LIB CACHE)

find_library(LIB
  NAMES PrefixInPATH
  HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib
  VALIDATOR check_ko
  )
message(STATUS "LIB='${LIB}'")
unset(LIB CACHE)