2021-06-29 05:14:16 +00:00
|
|
|
if(NOT FSP_IS_EXTERNAL_PROJECT)
|
|
|
|
set(FSP_PREFIX "" CACHE PATH "The path to the prefix of an libfsp installation")
|
|
|
|
set(FSP_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libfsp installation")
|
|
|
|
set(FSP_LIBRARY_DIR "" CACHE PATH "The path to the library of an libfsp installation")
|
|
|
|
|
|
|
|
set(_search_paths "")
|
2021-06-29 08:23:46 +00:00
|
|
|
if(FSP_INCLUDE_DIR AND EXISTS ${FSP_INCLUDE_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${FSP_INCLUDE_DIR})
|
|
|
|
endif()
|
2021-06-29 08:23:46 +00:00
|
|
|
if(FSP_PREFIX AND EXISTS ${FSP_PREFIX})
|
|
|
|
list(APPEND _search_paths "${FSP_PREFIX}/include")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
|
|
|
find_path(
|
|
|
|
FSP_INCLUDE_DIRS
|
|
|
|
NAMES fsp/mods.hpp
|
|
|
|
PATHS ${_search_paths})
|
|
|
|
|
|
|
|
set(_search_paths "")
|
2021-06-29 08:23:46 +00:00
|
|
|
if(FSP_LIBRARY_DIR AND EXISTS ${FSP_LIBRARY_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${FSP_LIBRARY_DIR})
|
|
|
|
endif()
|
2021-06-29 08:23:46 +00:00
|
|
|
if(FSP_PREFIX AND EXISTS ${FSP_PREFIX})
|
|
|
|
list(APPEND _search_paths "${FSP_PREFIX}/lib")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
|
|
|
find_library(
|
|
|
|
FSP_LIBRARIES
|
|
|
|
NAMES fsp
|
|
|
|
PATHS ${_search_paths})
|
|
|
|
unset(_search_paths)
|
|
|
|
|
|
|
|
if(FSP_INCLUDE_DIRS AND FSP_LIBRARIES)
|
|
|
|
set(FSP_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FSP_FOUND)
|
|
|
|
if(NOT FSP_FIND_QUIETLY)
|
|
|
|
message(STATUS "Found libfsp")
|
|
|
|
endif()
|
|
|
|
set(HAVE_FSP 1)
|
|
|
|
elseif(FSP_FOUND)
|
|
|
|
if(FSP_FIND_REQUIRED)
|
|
|
|
message(FATAL_ERROR "Could not find libfsp")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|