myx-cmake/MyxCMake/find/FindMyxQPing.cmake

46 lines
1.4 KiB
CMake
Raw Permalink Normal View History

2021-12-08 11:32:04 +00:00
if(NOT MYX_QPING_IS_EXTERNAL_PROJECT)
set(MYX_QPING_PREFIX "" CACHE PATH "The path to the prefix of an myx-qping installation")
set(MYX_QPING_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myx-qping installation")
set(MYX_QPING_LIBRARY_DIR "" CACHE PATH "The path to the library of an myx-qping installation")
set(_search_paths "")
if(MYX_QPING_INCLUDE_DIR AND EXISTS ${MYX_QPING_INCLUDE_DIR})
list(APPEND _search_paths ${MYX_QPING_INCLUDE_DIR})
endif()
if(MYX_QPING_PREFIX AND EXISTS ${MYX_QPING_PREFIX})
list(APPEND _search_paths "${MYX_QPING_PREFIX}/include")
endif()
find_path(
MYX_QPING_INCLUDE_DIRS
NAMES myx/qping/ping.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(MYX_QPING_LIBRARY_DIR AND EXISTS ${MYX_QPING_LIBRARY_DIR})
list(APPEND _search_paths ${MYX_QPING_LIBRARY_DIR})
endif()
if(MYX_QPING_PREFIX AND EXISTS ${MYX_QPING_PREFIX})
list(APPEND _search_paths "${MYX_QPING_PREFIX}/lib")
endif()
find_library(
MYX_QPING_LIBRARIES
NAMES myx-qping
PATHS ${_search_paths})
unset(_search_paths)
if(MYX_QPING_INCLUDE_DIRS AND MYX_QPING_LIBRARIES)
set(MYX_QPING_FOUND TRUE)
endif()
if(MYX_QPING_FOUND)
if(NOT MYX_QPING_FIND_QUIETLY)
message(STATUS "Found myx-qping")
endif()
set(HAVE_MYX_QPING 1)
elseif(MYX_QPING_FOUND)
if(MYX_QPING_FIND_REQUIRED)
message(FATAL_ERROR "Could not find myx-qping")
endif()
endif()
endif()