cmake-find/FindPreprocmath.cmake

46 lines
1.5 KiB
CMake
Raw Normal View History

if(NOT PREPROCMATH_IS_EXTERNAL_PROJECT)
set(PREPROCMATH_PREFIX "" CACHE PATH "The path to the prefix of an libpreprocmath installation")
set(PREPROCMATH_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libpreprocmath installation")
set(PREPROCMATH_LIBRARY_DIR "" CACHE PATH "The path to the library of an libpreprocmath installation")
2021-06-22 22:17:57 +00:00
set(_search_paths "")
if(PREPROCMATH_INCLUDE_DIR AND EXISTS ${PREPROCMATH_INCLUDE_DIR})
list(APPEND _search_paths ${PREPROCMATH_INCLUDE_DIR})
endif()
if(PREPROCMATH_PREFIX AND EXISTS ${PREPROCMATH_PREFIX})
list(APPEND _search_paths "${PREPROCMATH_PREFIX}/include")
endif()
2021-06-22 22:17:57 +00:00
find_path(
PREPROCMATH_INCLUDE_DIRS
2021-06-22 22:17:57 +00:00
NAMES preprocmath/params.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(PREPROCMATH_LIBRARY_DIR AND EXISTS ${PREPROCMATH_LIBRARY_DIR})
list(APPEND _search_paths ${PREPROCMATH_LIBRARY_DIR})
endif()
if(PREPROCMATH_PREFIX AND EXISTS ${PREPROCMATH_PREFIX})
list(APPEND _search_paths "${PREPROCMATH_PREFIX}/lib")
endif()
2021-06-22 22:17:57 +00:00
find_library(
PREPROCMATH_LIBRARIES
2021-06-22 22:17:57 +00:00
NAMES preprocmath
PATHS ${_search_paths})
unset(_search_paths)
2021-06-22 22:17:57 +00:00
if(PREPROCMATH_INCLUDE_DIRS AND PREPROCMATH_LIBRARIES)
set(PREPROCMATH_FOUND TRUE)
2021-06-22 22:17:57 +00:00
endif()
if(PREPROCMATH_FOUND)
if(NOT PREPROCMATH_FIND_QUIETLY)
2021-06-22 22:17:57 +00:00
message(STATUS "Found libpreprocmath")
endif()
set(HAVE_PREPROCMATH 1)
elseif(PREPROCMATH_FOUND)
if(PREPROCMATH_FIND_REQUIRED)
2021-06-22 22:17:57 +00:00
message(FATAL_ERROR "Could not find libpreprocmath")
endif()
endif()
endif()