cmake-find/FindIonobase.cmake

46 lines
1.3 KiB
CMake

if(NOT IONOBASE_IS_EXTERNAL_PROJECT)
set(IONOBASE_PREFIX "" CACHE PATH "The path to the prefix of an libionobase installation")
set(IONOBASE_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libionobase installation")
set(IONOBASE_LIBRARY_DIR "" CACHE PATH "The path to the library of an libionobase installation")
set(_search_paths "")
if(EXISTS IONOBASE_INCLUDE_DIR)
list(APPEND _search_paths ${IONOBASE_INCLUDE_DIR})
endif()
if(EXISTS IONOBASE_PREFIX)
list(APPEND _search_paths ${IONOBASE_PREFIX}/include)
endif()
find_path(
IONOBASE_INCLUDE_DIRS
NAMES ionobase/interchfor.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(EXISTS IONOBASE_LIBRARY_DIR)
list(APPEND _search_paths ${IONOBASE_LIBRARY_DIR})
endif()
if(EXISTS IONOBASE_PREFIX)
list(APPEND _search_paths ${IONOBASE_PREFIX}/lib)
endif()
find_library(
IONOBASE_LIBRARIES
NAMES ionobase
PATHS ${_search_paths})
unset(_search_paths)
if(IONOBASE_INCLUDE_DIRS AND IONOBASE_LIBRARIES)
set(IONOBASE_FOUND TRUE)
endif()
if(IONOBASE_FOUND)
if(NOT IONOBASE_FIND_QUIETLY)
message(STATUS "Found libionobase")
endif()
set(HAVE_IONOBASE 1)
elseif(IONOBASE_FOUND)
if(IONOBASE_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libionobase")
endif()
endif()
endif()