mirror of
https://github.com/pineappleEA/pineapple-src.git
synced 2024-12-04 23:28:24 -05:00
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -31,20 +31,24 @@ add_definitions(
|
||
|
-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
|
||
|
)
|
||
|
|
||
|
if (CMAKE_VERSION VERSION_GREATER "3.1")
|
||
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD 11)
|
||
|
set_property(TARGET sioclient PROPERTY CXX_STANDARD_REQUIRED ON)
|
||
|
else()
|
||
|
set_property(TARGET sioclient APPEND_STRING PROPERTY COMPILE_FLAGS "-std=c++11")
|
||
|
endif()
|
||
|
+
|
||
|
+target_link_libraries(sioclient PRIVATE websocketpp::websocketpp asio asio::asio rapidjson)
|
||
|
+
|
||
|
if(BUILD_SHARED_LIBS)
|
||
|
set_target_properties(sioclient
|
||
|
PROPERTIES
|
||
|
@@ -56,16 +59,13 @@ if(OPENSSL_FOUND)
|
||
|
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}
|
||
|
)
|
||
|
|
||
|
if (CMAKE_VERSION VERSION_GREATER "3.1")
|
||
|
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)
|
||
|
else()
|
||
|
set_property(TARGET sioclient_tls APPEND_STRING PROPERTY COMPILE_FLAGS "-std=c++11")
|
||
|
endif()
|