forked from microsoft/cpprestsdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpprest_find_websocketpp.cmake
27 lines (24 loc) · 1.07 KB
/
cpprest_find_websocketpp.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function(cpprest_find_websocketpp)
if(TARGET cpprestsdk_websocketpp_internal)
return()
endif()
find_package(WEBSOCKETPP CONFIG QUIET)
if(WEBSOCKETPP_FOUND)
message("-- Found websocketpp version " ${WEBSOCKETPP_VERSION} " on system")
set(WEBSOCKETPP_INCLUDE_DIR ${WEBSOCKETPP_INCLUDE_DIR} CACHE INTERNAL "")
elseif(EXISTS ${PROJECT_SOURCE_DIR}/libs/websocketpp/CMakeLists.txt)
message("-- websocketpp not found, using the embedded version")
set(WEBSOCKETPP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs/websocketpp CACHE INTERNAL "")
else()
message(FATAL_ERROR "-- websocketpp not found and embedded version not present; try `git submodule update --init` and run CMake again")
endif()
cpprest_find_boost()
cpprest_find_openssl()
add_library(cpprestsdk_websocketpp_internal INTERFACE)
target_include_directories(cpprestsdk_websocketpp_internal INTERFACE "$<BUILD_INTERFACE:${WEBSOCKETPP_INCLUDE_DIR}>")
target_link_libraries(cpprestsdk_websocketpp_internal
INTERFACE
cpprestsdk_boost_internal
cpprestsdk_openssl_internal
)
endfunction()