2021-06-29 05:14:16 +00:00
|
|
|
if(NOT PREPROC_IS_EXTERNAL_PROJECT)
|
|
|
|
set(PREPROC_PREFIX "" CACHE PATH "The path to the prefix of an libpreproc installation")
|
|
|
|
set(PREPROC_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libpreproc installation")
|
|
|
|
set(PREPROC_LIBRARY_DIR "" CACHE PATH "The path to the library of an libpreproc installation")
|
2021-06-23 04:34:59 +00:00
|
|
|
|
2021-06-29 05:14:16 +00:00
|
|
|
set(_search_paths "")
|
2021-06-29 09:56:20 +00:00
|
|
|
if(PREPROC_INCLUDE_DIR AND EXISTS ${PREPROC_INCLUDE_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${PREPROC_INCLUDE_DIR})
|
|
|
|
endif()
|
2021-06-29 09:56:20 +00:00
|
|
|
if(PREPROC_PREFIX AND EXISTS ${PREPROC_PREFIX})
|
|
|
|
list(APPEND _search_paths "${PREPROC_PREFIX}/include")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
2021-06-23 04:34:59 +00:00
|
|
|
find_path(
|
2021-06-29 05:14:16 +00:00
|
|
|
PREPROC_INCLUDE_DIRS
|
2021-06-23 04:34:59 +00:00
|
|
|
NAMES preproc/mark.hpp
|
2021-06-29 05:14:16 +00:00
|
|
|
PATHS ${_search_paths})
|
|
|
|
|
|
|
|
set(_search_paths "")
|
2021-06-29 09:56:20 +00:00
|
|
|
if(PREPROC_LIBRARY_DIR AND EXISTS ${PREPROC_LIBRARY_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${PREPROC_LIBRARY_DIR})
|
|
|
|
endif()
|
2021-06-29 09:56:20 +00:00
|
|
|
if(PREPROC_PREFIX AND EXISTS ${PREPROC_PREFIX})
|
|
|
|
list(APPEND _search_paths "${PREPROC_PREFIX}/lib")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
2021-06-23 04:34:59 +00:00
|
|
|
find_library(
|
2021-06-29 05:14:16 +00:00
|
|
|
PREPROC_LIBRARIES
|
2021-06-29 10:30:13 +00:00
|
|
|
NAMES preproc
|
2021-06-29 05:14:16 +00:00
|
|
|
PATHS ${_search_paths})
|
|
|
|
unset(_search_paths)
|
2021-06-23 04:34:59 +00:00
|
|
|
|
2021-06-29 05:14:16 +00:00
|
|
|
if(PREPROC_INCLUDE_DIRS AND PREPROC_LIBRARIES)
|
|
|
|
set(PREPROC_FOUND TRUE)
|
2021-06-23 04:34:59 +00:00
|
|
|
endif()
|
|
|
|
|
2021-06-29 05:14:16 +00:00
|
|
|
if(PREPROC_FOUND)
|
|
|
|
if(NOT PREPROC_FIND_QUIETLY)
|
2021-06-23 04:34:59 +00:00
|
|
|
message(STATUS "Found libpreproc")
|
|
|
|
endif()
|
2021-06-29 05:14:16 +00:00
|
|
|
set(HAVE_PREPROC 1)
|
|
|
|
elseif(PREPROC_FOUND)
|
|
|
|
if(PREPROC_FIND_REQUIRED)
|
2021-06-23 04:34:59 +00:00
|
|
|
message(FATAL_ERROR "Could not find libpreproc")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|