diff --git a/CHANGELOG.md b/CHANGELOG.md index 154a2d4c..775647aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Version 86: * Update README.md * Add local-travis.sh * Use winapi +* Update CMakeLists.txt for boost -------------------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index b46e43f3..aec188de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/example/echo-op/CMakeLists.txt b/example/echo-op/CMakeLists.txt index 68072c03..0cdb1a32 100644 --- a/example/echo-op/CMakeLists.txt +++ b/example/echo-op/CMakeLists.txt @@ -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) diff --git a/example/http-client-ssl/CMakeLists.txt b/example/http-client-ssl/CMakeLists.txt index 60df163f..db537cea 100644 --- a/example/http-client-ssl/CMakeLists.txt +++ b/example/http-client-ssl/CMakeLists.txt @@ -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} ) diff --git a/example/http-client/CMakeLists.txt b/example/http-client/CMakeLists.txt index 2b7d8ef0..6cf6f113 100644 --- a/example/http-client/CMakeLists.txt +++ b/example/http-client/CMakeLists.txt @@ -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) diff --git a/example/http-crawl/CMakeLists.txt b/example/http-crawl/CMakeLists.txt index c33a5e4a..af70400b 100644 --- a/example/http-crawl/CMakeLists.txt +++ b/example/http-crawl/CMakeLists.txt @@ -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) diff --git a/example/http-server-fast/CMakeLists.txt b/example/http-server-fast/CMakeLists.txt index 79580679..f4efd013 100644 --- a/example/http-server-fast/CMakeLists.txt +++ b/example/http-server-fast/CMakeLists.txt @@ -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} - ) - diff --git a/example/http-server-small/CMakeLists.txt b/example/http-server-small/CMakeLists.txt index b49d4a52..f183fefe 100644 --- a/example/http-server-small/CMakeLists.txt +++ b/example/http-server-small/CMakeLists.txt @@ -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 - ) - diff --git a/example/http-server-threaded/CMakeLists.txt b/example/http-server-threaded/CMakeLists.txt index 9dd68477..cccdc0a9 100644 --- a/example/http-server-threaded/CMakeLists.txt +++ b/example/http-server-threaded/CMakeLists.txt @@ -17,9 +17,3 @@ add_executable (http-server-threaded Jamfile http_server_threaded.cpp ) - -target_link_libraries(http-server-threaded - Beast - ${Boost_FILESYSTEM_LIBRARY} - ) - diff --git a/example/server-framework/CMakeLists.txt b/example/server-framework/CMakeLists.txt index 18d14219..508d436f 100644 --- a/example/server-framework/CMakeLists.txt +++ b/example/server-framework/CMakeLists.txt @@ -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() diff --git a/example/websocket-client-ssl/CMakeLists.txt b/example/websocket-client-ssl/CMakeLists.txt index e185fe72..fecc7291 100644 --- a/example/websocket-client-ssl/CMakeLists.txt +++ b/example/websocket-client-ssl/CMakeLists.txt @@ -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} ) diff --git a/example/websocket-client/CMakeLists.txt b/example/websocket-client/CMakeLists.txt index b7f41847..8fa7b234 100644 --- a/example/websocket-client/CMakeLists.txt +++ b/example/websocket-client/CMakeLists.txt @@ -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) diff --git a/example/websocket-server-async/CMakeLists.txt b/example/websocket-server-async/CMakeLists.txt index e4226953..a90a17c5 100644 --- a/example/websocket-server-async/CMakeLists.txt +++ b/example/websocket-server-async/CMakeLists.txt @@ -17,7 +17,3 @@ add_executable (websocket-server-async Jamfile websocket_server_async.cpp ) - -target_link_libraries(websocket-server-async - Beast - ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d87c8d79..dfd788fd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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() diff --git a/test/benchmarks/CMakeLists.txt b/test/benchmarks/CMakeLists.txt index 6f847bcd..dc587599 100644 --- a/test/benchmarks/CMakeLists.txt +++ b/test/benchmarks/CMakeLists.txt @@ -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} - ) diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt index 0551bf94..e8b43ebb 100644 --- a/test/common/CMakeLists.txt +++ b/test/common/CMakeLists.txt @@ -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() diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 2f034bcb..ac74ec50 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -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} - ) diff --git a/test/http/CMakeLists.txt b/test/http/CMakeLists.txt index d1496bb9..419fcffa 100644 --- a/test/http/CMakeLists.txt +++ b/test/http/CMakeLists.txt @@ -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} - ) diff --git a/test/server/CMakeLists.txt b/test/server/CMakeLists.txt index 82b26c81..70784bb4 100644 --- a/test/server/CMakeLists.txt +++ b/test/server/CMakeLists.txt @@ -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() diff --git a/test/websocket/CMakeLists.txt b/test/websocket/CMakeLists.txt index 846859fb..d0e50da1 100644 --- a/test/websocket/CMakeLists.txt +++ b/test/websocket/CMakeLists.txt @@ -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() diff --git a/test/wstest/CMakeLists.txt b/test/wstest/CMakeLists.txt index e7120d88..bff18aa0 100644 --- a/test/wstest/CMakeLists.txt +++ b/test/wstest/CMakeLists.txt @@ -19,7 +19,3 @@ add_executable (wstest Jamfile main.cpp ) - -target_link_libraries(wstest - Beast - ) diff --git a/test/zlib/CMakeLists.txt b/test/zlib/CMakeLists.txt index 22f813e4..87194104 100644 --- a/test/zlib/CMakeLists.txt +++ b/test/zlib/CMakeLists.txt @@ -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} - )