2021-07-01 22:38:43 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-10-27 14:34:56 +08:00
|
|
|
@@ -31,20 +31,24 @@ 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
|
|
|
|
)
|
|
|
|
|
2021-10-27 14:34:56 +08:00
|
|
|
if (CMAKE_VERSION VERSION_GREATER "3.1")
|
2021-07-01 22:38:43 +08:00
|
|
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD_REQUIRED ON)
|
2021-10-27 14:34:56 +08:00
|
|
|
else()
|
|
|
|
set_property(TARGET sioclient APPEND_STRING PROPERTY COMPILE_FLAGS "-std=c++11")
|
|
|
|
endif()
|
|
|
|
+
|
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
|
2021-10-27 14:34:56 +08:00
|
|
|
@@ -56,16 +59,13 @@ 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-10-27 14:34:56 +08:00
|
|
|
if (CMAKE_VERSION VERSION_GREATER "3.1")
|
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)
|
2021-10-27 14:34:56 +08:00
|
|
|
else()
|
|
|
|
set_property(TARGET sioclient_tls APPEND_STRING PROPERTY COMPILE_FLAGS "-std=c++11")
|
|
|
|
endif()
|