mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 06:44:39 +02:00
Update CMakeLists.txt for boost
This commit is contained in:
@@ -6,6 +6,7 @@ Version 86:
|
||||
* Update README.md
|
||||
* Add local-travis.sh
|
||||
* Use winapi
|
||||
* Update CMakeLists.txt for boost
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -58,20 +58,20 @@ endif()
|
||||
# Boost
|
||||
#
|
||||
|
||||
option (Boost_USE_STATIC_LIBS "Use static libraries for boost" ON)
|
||||
get_filename_component (BOOST_ROOT ../../ ABSOLUTE)
|
||||
|
||||
# VFALCO I want static but "b2 stage" builds a minimal set which excludes static
|
||||
add_definitions (-DBOOST_ALL_STATIC_LINK=1)
|
||||
|
||||
add_definitions (-DBOOST_ASIO_DISABLE_BOOST_ARRAY=1)
|
||||
add_definitions (-DBOOST_ASIO_DISABLE_BOOST_BIND=1)
|
||||
add_definitions (-DBOOST_ASIO_DISABLE_BOOST_DATE_TIME=1)
|
||||
add_definitions (-DBOOST_ASIO_DISABLE_BOOST_REGEX=1)
|
||||
add_definitions (-DBOOST_COROUTINES_NO_DEPRECATION_WARNING=1)
|
||||
|
||||
set(BOOST_COMPONENTS system)
|
||||
if (Beast_BUILD_EXAMPLES OR Beast_BUILD_TESTS)
|
||||
list(APPEND BOOST_COMPONENTS coroutine context filesystem program_options thread)
|
||||
endif()
|
||||
find_package (Boost 1.58.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
include_directories (${BOOST_ROOT})
|
||||
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
link_directories(${BOOST_ROOT}/stage/lib)
|
||||
|
||||
if (MINGW)
|
||||
link_libraries(ws2_32 mswsock)
|
||||
@@ -150,20 +150,6 @@ elseif ("${VARIANT}" STREQUAL "release")
|
||||
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Library interface
|
||||
#
|
||||
|
||||
add_library (${PROJECT_NAME} INTERFACE)
|
||||
target_link_libraries (${PROJECT_NAME} INTERFACE ${Boost_SYSTEM_LIBRARY})
|
||||
if (NOT MSVC)
|
||||
target_link_libraries (${PROJECT_NAME} INTERFACE Threads::Threads)
|
||||
endif()
|
||||
target_compile_definitions (${PROJECT_NAME} INTERFACE BOOST_COROUTINES_NO_DEPRECATION_WARNING=1)
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE ${PROJECT_SOURCE_DIR}/include)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Tests and examples
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/echo-op "/")
|
||||
|
||||
add_executable (echo-op
|
||||
@@ -16,5 +15,3 @@ add_executable (echo-op
|
||||
Jamfile
|
||||
echo_op.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(echo-op Beast)
|
||||
|
@@ -18,7 +18,6 @@ add_executable (http-client-ssl
|
||||
http_client_ssl.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-client-ssl
|
||||
Beast
|
||||
target_link_libraries (http-client-ssl
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/http-client "/")
|
||||
|
||||
add_executable (http-client
|
||||
@@ -16,5 +15,3 @@ add_executable (http-client
|
||||
Jamfile
|
||||
http_client.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-client Beast)
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/http-crawl "/")
|
||||
|
||||
add_executable (http-crawl
|
||||
@@ -19,4 +18,3 @@ add_executable (http-crawl
|
||||
http_crawl.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-crawl Beast)
|
||||
|
@@ -18,9 +18,3 @@ add_executable (http-server-fast
|
||||
fields_alloc.hpp
|
||||
http_server_fast.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-fast
|
||||
Beast
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/http-server-small "/")
|
||||
|
||||
add_executable (http-server-small
|
||||
@@ -16,8 +15,3 @@ add_executable (http-server-small
|
||||
Jamfile
|
||||
http_server_small.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-small
|
||||
Beast
|
||||
)
|
||||
|
||||
|
@@ -17,9 +17,3 @@ add_executable (http-server-threaded
|
||||
Jamfile
|
||||
http_server_threaded.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-threaded
|
||||
Beast
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/server-framework "/")
|
||||
GroupSources(example/common "common")
|
||||
|
||||
@@ -24,12 +23,8 @@ add_executable (server-framework
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
server-framework
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY})
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
target_link_libraries(server-framework ${OPENSSL_LIBRARIES})
|
||||
target_link_libraries(server-framework
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/websocket-client-ssl "/")
|
||||
|
||||
add_executable (websocket-client-ssl
|
||||
@@ -18,6 +17,5 @@ add_executable (websocket-client-ssl
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-client-ssl
|
||||
Beast
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(example/websocket-client "/")
|
||||
|
||||
add_executable (websocket-client
|
||||
@@ -16,5 +15,3 @@ add_executable (websocket-client
|
||||
Jamfile
|
||||
websocket_client.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-client Beast)
|
||||
|
@@ -17,7 +17,3 @@ add_executable (websocket-server-async
|
||||
Jamfile
|
||||
websocket_server_async.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-async
|
||||
Beast
|
||||
)
|
||||
|
@@ -39,8 +39,6 @@ if ((NOT "${VARIANT}" STREQUAL "coverage") AND
|
||||
zlib.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(lib-tests Beast ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
|
||||
if (MINGW)
|
||||
set_target_properties(lib-tests PROPERTIES COMPILE_FLAGS "-Wa,-mbig-obj")
|
||||
endif()
|
||||
|
@@ -9,7 +9,6 @@
|
||||
|
||||
GroupSources(extras/boost/beast extras)
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(test/benchmarks "/")
|
||||
GroupSources(test/http "/")
|
||||
|
||||
@@ -25,9 +24,3 @@ add_executable (benchmarks
|
||||
parser.cpp
|
||||
utf8_checker.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(benchmarks
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
@@ -24,13 +24,8 @@ add_executable (common-test
|
||||
write_msg.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(common-test
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
target_link_libraries (common-test ${OPENSSL_LIBRARIES})
|
||||
target_link_libraries (common-test
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
@@ -10,7 +10,6 @@
|
||||
GroupSources(example example)
|
||||
GroupSources(extras/boost/beast extras)
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(test/core "/")
|
||||
|
||||
add_executable (core-tests
|
||||
@@ -55,12 +54,3 @@ add_executable (core-tests
|
||||
sha1.cpp
|
||||
detail/varint.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(core-tests
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_COROUTINE_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_CONTEXT_LIBRARY}
|
||||
)
|
||||
|
@@ -10,7 +10,6 @@
|
||||
GroupSources(example example)
|
||||
GroupSources(extras/boost/beast extras)
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(test/http "/")
|
||||
|
||||
add_executable (http-tests
|
||||
@@ -47,12 +46,3 @@ add_executable (http-tests
|
||||
verb.cpp
|
||||
write.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-tests
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_COROUTINE_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_CONTEXT_LIBRARY}
|
||||
)
|
||||
|
@@ -11,7 +11,6 @@ GroupSources(example/server-framework framework)
|
||||
GroupSources(example/common common)
|
||||
GroupSources(extras/boost/beast extras)
|
||||
GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(test/server "/")
|
||||
|
||||
add_executable (server-test
|
||||
@@ -37,12 +36,8 @@ add_executable (server-test
|
||||
wss_ports.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(server-test
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
target_link_libraries (server-test ${OPENSSL_LIBRARIES})
|
||||
target_link_libraries (server-test
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
@@ -12,8 +12,6 @@ GroupSources(include/boost/beast beast)
|
||||
|
||||
GroupSources(test/websocket "/")
|
||||
|
||||
#include_directories(../../example/)
|
||||
|
||||
add_executable (websocket-tests
|
||||
${BOOST_BEAST_INCLUDES}
|
||||
${EXTRAS_INCLUDES}
|
||||
@@ -32,15 +30,8 @@ add_executable (websocket-tests
|
||||
utf8_checker.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-tests
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_COROUTINE_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_CONTEXT_LIBRARY}
|
||||
)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
target_link_libraries(websocket-tests ${OPENSSL_LIBRARIES})
|
||||
target_link_libraries(websocket-tests
|
||||
${OPENSSL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
@@ -19,7 +19,3 @@ add_executable (wstest
|
||||
Jamfile
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(wstest
|
||||
Beast
|
||||
)
|
||||
|
@@ -50,9 +50,3 @@ add_executable (zlib-tests
|
||||
error.cpp
|
||||
inflate_stream.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(zlib-tests
|
||||
Beast
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
Reference in New Issue
Block a user