Files
CMake/Tests/RunCMake/find_library/Required.cmake
Sylvain Joubert dc00809596 find_*: Add support for REQUIRED keyword
In the same spirit as the REQUIRED keyword on find_package, this will
stop cmake execution with an error on a failed find_program, find_file,
find_path or find_library.
2020-03-06 16:40:26 +01:00

15 lines
317 B
CMake

list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_library(LIB_exists
NAMES PrefixInPATH
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib
NO_DEFAULT_PATH
REQUIRED
)
message(STATUS "LIB_exists='${LIB_exists}'")
find_library(LIB_doNotExists
NAMES doNotExists
REQUIRED
)