From fb5cd4d32d20731e02297ffe5a75fece127e3b57 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 3 Dec 2021 14:41:30 +0100 Subject: [PATCH] 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. --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c312d21..1258aae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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)