Build up to date version of Boost libraries

System versions can still be used (if they're _somewhat_ up to date,
the ones on <= xenial are too old).
This commit is contained in:
TheAssassin 2018-06-08 02:04:20 +02:00
parent 030b21379b
commit 96bf015722
7 changed files with 40 additions and 4 deletions

12
.gitmodules vendored
View File

@ -7,3 +7,15 @@
[submodule "lib/cpp-feather-ini-parser"]
path = lib/cpp-feather-ini-parser
url = https://github.com/Turbine1991/cpp-feather-ini-parser.git
[submodule "lib/boost-filesystem"]
path = lib/boost-filesystem
url = https://github.com/boostorg/filesystem.git
[submodule "lib/lib/boost-regex"]
path = lib/lib/boost-regex
url = https://github.com/boostorg/regex.git
[submodule "lib/boost-regex"]
path = lib/boost-regex
url = https://github.com/boostorg/regex.git
[submodule "lib/boost-system"]
path = lib/boost-system
url = https://github.com/boostorg/system.git

View File

@ -10,6 +10,8 @@ add_definitions(-DLINUXDEPLOY_VERSION="${LINUXDEPLOY_VERSION}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
set(USE_SYSTEM_BOOST OFF CACHE BOOL "Set to ON to use system boost libraries instead of building up to date boost libraries from source")
add_subdirectory(lib)
add_subdirectory(src)

View File

@ -13,3 +13,17 @@ target_include_directories(cpp-feather-ini-parser INTERFACE cpp-feather-ini-pars
add_executable(test_cpp_feather_ini_parser EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/cpp-feather-ini-parser/example/example.cpp)
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)
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)
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)
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)
endif()

1
lib/boost-filesystem Submodule

@ -0,0 +1 @@
Subproject commit d8a6730d6ebab6da39c5f774e7c7ce966507901a

1
lib/boost-regex Submodule

@ -0,0 +1 @@
Subproject commit 5d990fd751a8c149dd47fbaf24eaaffd1bde3bd5

1
lib/boost-system Submodule

@ -0,0 +1 @@
Subproject commit 6a71483984aaa651f0d2c199b5465df961154cff

View File

@ -5,8 +5,14 @@ cmake_minimum_required(VERSION 3.6)
# include headers to make CLion happy
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/linuxdeploy/core/*.h)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS filesystem regex)
if(USE_SYSTEM_BOOST)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS filesystem regex)
set(BOOST_LIBS Boost::filesystem Boost::regex)
else()
# use custom built libs
set(BOOST_LIBS Boost_system Boost_filesystem Boost_regex)
endif()
find_package(Threads)
@ -22,12 +28,11 @@ execute_process(
)
add_library(linuxdeploy_core STATIC elf.cpp log.cpp appdir.cpp desktopfile.cpp ${HEADERS})
target_link_libraries(linuxdeploy_core PUBLIC linuxdeploy_util Boost::filesystem Boost::regex subprocess cpp-feather-ini-parser PkgConfig::magick++ libmagic_static ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(linuxdeploy_core PUBLIC linuxdeploy_util ${BOOST_LIBS} subprocess cpp-feather-ini-parser PkgConfig::magick++ libmagic_static ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(linuxdeploy_core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(linuxdeploy_core PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_compile_definitions(linuxdeploy_core PUBLIC -DBOOST_NO_CXX11_SCOPED_ENUMS)
add_executable(linuxdeploy main.cpp)
target_link_libraries(linuxdeploy linuxdeploy_core args)
set_target_properties(linuxdeploy PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")