2021-07-01 22:38:43 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2021-07-08 00:26:53 +08:00
|
|
|
index 19c5e54..9d2e1ec 100644
|
2021-07-01 22:38:43 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-07-08 00:26:53 +08:00
|
|
|
@@ -31,17 +31,20 @@ add_definitions(
|
2021-07-01 22:38:43 +08:00
|
|
|
-D_WEBSOCKETPP_CPP11_FUNCTIONAL_
|
|
|
|
)
|
|
|
|
|
|
|
|
+find_package(websocketpp CONFIG REQUIRED)
|
|
|
|
+find_package(asio CONFIG REQUIRED)
|
|
|
|
+find_package(RapidJSON CONFIG REQUIRED)
|
|
|
|
+
|
|
|
|
add_library(sioclient ${ALL_SRC})
|
|
|
|
target_include_directories(sioclient PRIVATE
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/asio/asio/include
|
|
|
|
)
|
|
|
|
|
|
|
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2021-07-08 00:26:53 +08:00
|
|
|
+target_link_libraries(sioclient PRIVATE websocketpp::websocketpp asio asio::asio rapidjson)
|
|
|
|
+
|
2021-07-01 22:38:43 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set_target_properties(sioclient
|
2021-07-08 00:26:53 +08:00
|
|
|
PROPERTIES
|
|
|
|
@@ -56,15 +59,12 @@ if(OPENSSL_FOUND)
|
2021-07-01 22:38:43 +08:00
|
|
|
add_library(sioclient_tls ${ALL_SRC})
|
|
|
|
target_include_directories(sioclient_tls PRIVATE
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/websocketpp
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson/include
|
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/lib/asio/asio/include
|
|
|
|
${OPENSSL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2021-07-08 00:26:53 +08:00
|
|
|
set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET sioclient_tls PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
-target_link_libraries(sioclient_tls PRIVATE ${OPENSSL_LIBRARIES} )
|
|
|
|
+target_link_libraries(sioclient_tls PRIVATE ${OPENSSL_LIBRARIES} websocketpp::websocketpp asio asio::asio rapidjson)
|
|
|
|
target_compile_definitions(sioclient_tls PRIVATE -DSIO_TLS)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set_target_properties(sioclient_tls
|