2018-02-14 11:55:04 +00:00
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_WEBSOCKETS libwebsockets)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_extra_dirs_lib(WEBSOCKETS websockets)
|
|
|
|
find_library(WEBSOCKETS_LIBRARY
|
2020-09-17 11:44:47 +00:00
|
|
|
NAMES websockets websockets.17
|
2018-02-14 11:55:04 +00:00
|
|
|
HINTS ${HINTS_WEBSOCKETS_LIBDIR} ${PC_WEBSOCKETS_LIBDIR} ${PC_WEBSOCKETS_LIBRARY_DIRS}
|
|
|
|
PATHS ${PATHS_WEBSOCKETS_LIBDIR}
|
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
|
|
)
|
|
|
|
set_extra_dirs_include(WEBSOCKETS websockets "${WEBSOCKETS_LIBRARY}")
|
|
|
|
find_path(WEBSOCKETS_INCLUDEDIR
|
|
|
|
NAMES libwebsockets.h
|
|
|
|
HINTS ${HINTS_WEBSOCKETS_INCLUDEDIR} ${PC_WEBSOCKETS_INCLUDEDIR} ${PC_WEBSOCKETS_INCLUDE_DIRS}
|
|
|
|
PATHS ${PATHS_WEBSOCKETS_INCLUDEDIR}
|
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Websockets DEFAULT_MSG WEBSOCKETS_LIBRARY WEBSOCKETS_INCLUDEDIR)
|
|
|
|
|
|
|
|
mark_as_advanced(WEBSOCKETS_LIBRARY WEBSOCKETS_INCLUDEDIR)
|
|
|
|
|
|
|
|
if(WEBSOCKETS_FOUND)
|
|
|
|
set(WEBSOCKETS_LIBRARIES ${WEBSOCKETS_LIBRARY})
|
|
|
|
set(WEBSOCKETS_INCLUDE_DIRS ${WEBSOCKETS_INCLUDEDIR})
|
|
|
|
|
|
|
|
is_bundled(WEBSOCKETS_BUNDLED "${WEBSOCKETS_LIBRARY}")
|
2021-12-14 23:58:35 +00:00
|
|
|
set(WEBSOCKETS_COPY_FILES)
|
|
|
|
if(WEBSOCKETS_BUNDLED)
|
|
|
|
if(TARGET_OS STREQUAL "windows")
|
|
|
|
set(WEBSOCKETS_COPY_FILES "${EXTRA_WEBSOCKETS_LIBDIR}/libwebsockets.dll")
|
|
|
|
elseif(TARGET_OS STREQUAL "mac")
|
|
|
|
set(WEBSOCKETS_COPY_FILES "${EXTRA_WEBSOCKETS_LIBDIR}/libwebsockets.18.dylib")
|
|
|
|
endif()
|
2020-09-16 15:16:13 +00:00
|
|
|
endif()
|
2018-02-14 11:55:04 +00:00
|
|
|
endif()
|