Simplify Boost integration

This commit is contained in:
Daniel Wolf 2025-02-17 16:04:29 +01:00
parent b8298a0592
commit bd685131e8
1 changed files with 4 additions and 7 deletions

View File

@ -50,13 +50,10 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Define libraries # Define libraries
# ... Boost # ... Boost
set(Boost_USE_STATIC_LIBS ON) # Use static libs cmake_policy(SET CMP0167 OLD) # Use the legacy Boost CMake integration
set(Boost_USE_MULTITHREADED ON) # Enable multithreading support
set(Boost_USE_STATIC_RUNTIME ON) # Use static C++ runtime
set(Boost_NO_BOOST_CMAKE ON) # Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18865
find_package(Boost 1.54 REQUIRED) find_package(Boost 1.54 REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES}) # Just about every project needs Boost link_libraries(Boost::headers) # Just about every project needs Boost, but just the headers
# ... C++ Format # ... C++ Format
FILE(GLOB cppFormatFiles "lib/cppformat/*.cc") FILE(GLOB cppFormatFiles "lib/cppformat/*.cc")
@ -534,7 +531,7 @@ target_link_libraries(runTests
function(copy_and_install sourceGlob relativeTargetDirectory) function(copy_and_install sourceGlob relativeTargetDirectory)
# Set `sourcePaths` # Set `sourcePaths`
file(GLOB sourcePaths "${sourceGlob}") file(GLOB sourcePaths "${sourceGlob}")
foreach(sourcePath ${sourcePaths}) foreach(sourcePath ${sourcePaths})
if(NOT IS_DIRECTORY ${sourcePath}) if(NOT IS_DIRECTORY ${sourcePath})
# Set `fileName` # Set `fileName`
@ -559,7 +556,7 @@ endfunction()
function(copy sourceGlob relativeTargetDirectory) function(copy sourceGlob relativeTargetDirectory)
# Set `sourcePaths` # Set `sourcePaths`
file(GLOB sourcePaths "${sourceGlob}") file(GLOB sourcePaths "${sourceGlob}")
foreach(sourcePath ${sourcePaths}) foreach(sourcePath ${sourcePaths})
if(NOT IS_DIRECTORY ${sourcePath}) if(NOT IS_DIRECTORY ${sourcePath})
# Set `fileName` # Set `fileName`