cmake-find/FindIonobase.cmake

46 lines
1.4 KiB
CMake
Raw Normal View History

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")
2021-06-22 23:11:10 +00:00
set(_search_paths "")
if(IONOBASE_INCLUDE_DIR AND EXISTS ${IONOBASE_INCLUDE_DIR})
list(APPEND _search_paths ${IONOBASE_INCLUDE_DIR})
endif()
if(IONOBASE_PREFIX AND EXISTS ${IONOBASE_PREFIX})
list(APPEND _search_paths "${IONOBASE_PREFIX}/include")
endif()
2021-06-22 23:11:10 +00:00
find_path(
IONOBASE_INCLUDE_DIRS
2021-06-24 09:03:01 +00:00
NAMES ionobase/interchfor.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(IONOBASE_LIBRARY_DIR AND EXISTS ${IONOBASE_LIBRARY_DIR})
list(APPEND _search_paths ${IONOBASE_LIBRARY_DIR})
endif()
if(IONOBASE_PREFIX AND EXISTS ${IONOBASE_PREFIX})
list(APPEND _search_paths "${IONOBASE_PREFIX}/lib")
endif()
2021-06-22 23:11:10 +00:00
find_library(
IONOBASE_LIBRARIES
2021-06-24 09:03:01 +00:00
NAMES ionobase
PATHS ${_search_paths})
unset(_search_paths)
2021-06-22 23:11:10 +00:00
if(IONOBASE_INCLUDE_DIRS AND IONOBASE_LIBRARIES)
set(IONOBASE_FOUND TRUE)
2021-06-22 23:11:10 +00:00
endif()
if(IONOBASE_FOUND)
if(NOT IONOBASE_FIND_QUIETLY)
2021-06-22 23:11:10 +00:00
message(STATUS "Found libionobase")
endif()
set(HAVE_IONOBASE 1)
elseif(IONOBASE_FOUND)
if(IONOBASE_FIND_REQUIRED)
2021-06-22 23:11:10 +00:00
message(FATAL_ERROR "Could not find libionobase")
endif()
endif()
endif()