mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
32 lines
1.1 KiB
CMake
32 lines
1.1 KiB
CMake
|
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
|
||
|
NAMES websockets
|
||
|
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}")
|
||
|
endif()
|