From a85dede6fe361100c5fd502ee093453f074bdaaa Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 29 Jun 2018 01:38:09 +0200 Subject: [PATCH] Standalone boost builds, mk. 1 --- .gitmodules | 3 +++ .travis.yml | 2 -- lib/CMakeLists.txt | 18 ++++++++++++------ lib/boost-config | 1 + src/CMakeLists.txt | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) create mode 160000 lib/boost-config diff --git a/.gitmodules b/.gitmodules index c8a3105..46826c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "lib/boost-system"] path = lib/boost-system url = https://github.com/boostorg/system.git +[submodule "lib/boost-config"] + path = lib/boost-config + url = https://github.com/boostorg/config.git diff --git a/.travis.yml b/.travis.yml index a613706..1c3a595 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ addons: apt: update: true packages: - - libboost-regex1.55-dev - - libboost-filesystem1.55-dev - libmagic-dev - cimg-dev - automake # required for patchelf diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f92a74a..a922c22 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -15,15 +15,21 @@ target_link_libraries(test_cpp_feather_ini_parser PRIVATE cpp-feather-ini-parser add_test(test_cpp_feather_ini_parser test_cpp_feather_ini_parser) if(NOT USE_SYSTEM_BOOST) + add_library(boost_config IMPORTED INTERFACE) + set_property(TARGET boost_config PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$") + file(GLOB boost_system_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-system/src/*.cpp) - add_library(Boost_system STATIC ${boost_system_srcs}) - target_include_directories(Boost_system PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-system/include) + add_library(boost_system STATIC ${boost_system_srcs}) + target_include_directories(boost_system PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-system/include) + target_link_libraries(boost_system INTERFACE boost_config) file(GLOB boost_filesystem_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-filesystem/src/*.cpp) - add_library(Boost_filesystem STATIC ${boost_filesystem_srcs}) - target_include_directories(Boost_filesystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-filesystem/include) + add_library(boost_filesystem STATIC ${boost_filesystem_srcs}) + target_include_directories(boost_filesystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-filesystem/include) + target_link_libraries(boost_filesystem INTERFACE boost_config) file(GLOB boost_regex_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-regex/src/*.cpp) - add_library(Boost_regex STATIC ${boost_regex_srcs}) - target_include_directories(Boost_regex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-regex/include) + add_library(boost_regex STATIC ${boost_regex_srcs}) + target_include_directories(boost_regex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-regex/include) + target_link_libraries(boost_regex INTERFACE boost_config) endif() diff --git a/lib/boost-config b/lib/boost-config new file mode 160000 index 0000000..59ea08b --- /dev/null +++ b/lib/boost-config @@ -0,0 +1 @@ +Subproject commit 59ea08b918fd3d5587ab0699b7093a28bcde9a24 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 77f9e80..5911676 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,7 +7,7 @@ if(USE_SYSTEM_BOOST) set(BOOST_LIBS Boost::filesystem Boost::regex) else() # use custom built libs - set(BOOST_LIBS Boost_system Boost_filesystem Boost_regex) + set(BOOST_LIBS boost_system boost_filesystem boost_regex) endif() add_subdirectory(util)