Standalone boost builds, mk. 1

This commit is contained in:
TheAssassin 2018-06-29 01:38:09 +02:00
parent 091a3cb527
commit a85dede6fe
5 changed files with 17 additions and 9 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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

View File

@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-config/include>")
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()

1
lib/boost-config Submodule

@ -0,0 +1 @@
Subproject commit 59ea08b918fd3d5587ab0699b7093a28bcde9a24

View File

@ -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)