cmake fixes
This commit is contained in:
@@ -6,13 +6,22 @@ set(ASIO_FOUND FALSE)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_path(ASIO_DIR asio.hpp HINTS ${ASIO_INSTALL_DIR} PATH_SUFFIXES include)
|
||||
set(ASIO_INSTALL_DIR "" CACHE STRING "ASIO install dir")
|
||||
set(ASIO_INSTALL_DIR_INTERNAL "" CACHE STRING "ASIO install dir")
|
||||
if(NOT "${ASIO_INSTALL_DIR}" STREQUAL "${ASIO_INSTALL_DIR_INTERNAL}") # ASIO_INSTALL_DIR is given in command-line
|
||||
unset(ASIO_INCLUDE_DIR CACHE)
|
||||
find_path(ASIO_DIR asio.hpp HINTS ${ASIO_INSTALL_DIR} PATH_SUFFIXES include)
|
||||
else() # in system path
|
||||
find_path(ASIO_DIR asio.hpp PATH_SUFFIXES include)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if (NOT ASIO_DIR)
|
||||
message(WARNING "Cannot find ASIO library headers!")
|
||||
set(ASIO_FOUND FALSE)
|
||||
else()
|
||||
message(STATUS "Found ASIO: TRUE (${ASIO_DIR})")
|
||||
message(STATUS "Found ASIO: (${ASIO_DIR})")
|
||||
|
||||
# ASIO is header-only library so it is IMPORTED target
|
||||
add_library(ASIO::ASIO INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
Reference in New Issue
Block a user