Require static boost libs only if necessary

Some distros don't ship static libraries by default, therefore requiring
them by default breaks on those. Also, it makes no sense, really.

Fixes one build issue on openSUSE Leap.
This commit is contained in:
TheAssassin 2021-12-03 14:41:30 +01:00
parent 5fb5ca5a8b
commit fb5cd4d32d

View File

@ -4,7 +4,10 @@ cmake_minimum_required(VERSION 3.5)
# globally include own includes
include_directories(${PROJECT_SOURCE_DIR}/include)
set(Boost_USE_STATIC_LIBS ON)
if(STATIC_BUILD)
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost REQUIRED COMPONENTS filesystem regex)
set(BOOST_LIBS Boost::filesystem Boost::regex)