blob: c24e64019d29a0c5177db35a6fb34043fe43939b (
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
|
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
set(ENV_PATH "$ENV{PATH}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created")
set(CMAKE_FIND_DEBUG_MODE 1)
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}/lib")
find_library(CREATED_LIBRARY NAMES created created_no_exist)
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}/lib")
find_library(CREATED_LIBRARY NAMES created)
set(CMAKE_FIND_DEBUG_MODE 0)
foreach(path "/does_not_exist" "/lib" "")
unset(CREATED_LIBRARY CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}")
find_library(CREATED_LIBRARY NAMES created)
message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
endforeach()
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
foreach(path "/does_not_exist" "/lib" "")
unset(CREATED_LIBRARY CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}")
find_library(CREATED_LIBRARY NAMES created)
message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
endforeach()
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
set(ENV{PATH} "${ENV_PATH}")
|