cmake-find/FindMyxGeo.cmake

46 lines
1.4 KiB
CMake
Raw Permalink Normal View History

2021-10-07 06:18:36 +00:00
if(NOT MYX_GEO_IS_EXTERNAL_PROJECT)
set(MYX_GEO_PREFIX "" CACHE PATH "The path to the prefix of an myx-geo installation")
set(MYX_GEO_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myx-geo installation")
set(MYX_GEO_LIBRARY_DIR "" CACHE PATH "The path to the library of an myx-geo installation")
set(_search_paths "")
if(MYX_GEO_INCLUDE_DIR AND EXISTS ${MYX_GEO_INCLUDE_DIR})
list(APPEND _search_paths ${MYX_GEO_INCLUDE_DIR})
endif()
if(MYX_GEO_PREFIX AND EXISTS ${MYX_GEO_PREFIX})
list(APPEND _search_paths "${MYX_GEO_PREFIX}/include")
endif()
find_path(
MYX_GEO_INCLUDE_DIRS
NAMES myx/geo/const.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(MYX_GEO_LIBRARY_DIR AND EXISTS ${MYX_GEO_LIBRARY_DIR})
list(APPEND _search_paths ${MYX_GEO_LIBRARY_DIR})
endif()
if(MYX_GEO_PREFIX AND EXISTS ${MYX_GEO_PREFIX})
list(APPEND _search_paths "${MYX_GEO_PREFIX}/lib")
endif()
find_library(
MYX_GEO_LIBRARIES
NAMES myx-geo
PATHS ${_search_paths})
unset(_search_paths)
if(MYX_GEO_INCLUDE_DIRS AND MYX_GEO_LIBRARIES)
set(MYX_GEO_FOUND TRUE)
endif()
if(MYX_GEO_FOUND)
if(NOT MYX_GEO_FIND_QUIETLY)
message(STATUS "Found myx-geo")
endif()
set(HAVE_MYX_GEO 1)
elseif(MYX_GEO_FOUND)
if(MYX_GEO_FIND_REQUIRED)
message(FATAL_ERROR "Could not find myx-geo")
endif()
endif()
endif()