Начало проекта
This commit is contained in:
45
MyxCMake/find/FindPreprocmath.cmake
Normal file
45
MyxCMake/find/FindPreprocmath.cmake
Normal file
@@ -0,0 +1,45 @@
|
||||
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")
|
||||
|
||||
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()
|
||||
find_path(
|
||||
PREPROCMATH_INCLUDE_DIRS
|
||||
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()
|
||||
find_library(
|
||||
PREPROCMATH_LIBRARIES
|
||||
NAMES preprocmath
|
||||
PATHS ${_search_paths})
|
||||
unset(_search_paths)
|
||||
|
||||
if(PREPROCMATH_INCLUDE_DIRS AND PREPROCMATH_LIBRARIES)
|
||||
set(PREPROCMATH_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(PREPROCMATH_FOUND)
|
||||
if(NOT PREPROCMATH_FIND_QUIETLY)
|
||||
message(STATUS "Found libpreprocmath")
|
||||
endif()
|
||||
set(HAVE_PREPROCMATH 1)
|
||||
elseif(PREPROCMATH_FOUND)
|
||||
if(PREPROCMATH_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find libpreprocmath")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
Reference in New Issue
Block a user