From 6c418d1fb143b9a9647845207f6d52d0fcb831ea Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 12 Sep 2017 20:39:48 +0200 Subject: [PATCH] Split up BOOST_LIBS into _OPTIONAL & _REQUIRED lists (currently only 'header' as required). Only sets up target for libs found in BOOST_SOURCE/libs/libname. This allows to build boost with only a subset of the libs (if for example using bcp). Fixed copy-paste typo Renamed cmake-files in /libs to equal corresponding module-name in boost-repo/libs. Moved 'added '-message into the script actually adding the lib. Removed 'added lib'-message --- CMakeLists.txt | 16 ++++++++++++---- libs/{unit_test_framework.cmake => test.cmake} | 0 2 files changed, 12 insertions(+), 4 deletions(-) rename libs/{unit_test_framework.cmake => test.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 294aedf05..562d3dcfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,11 @@ if(USE_ANDROID) set(CMAKE_ASM_COMPILER_TARGET "${CMAKE_CXX_COMPILER_TARGET}") endif() -set(BOOST_LIBS +set(BOOST_LIBS_REQUIRED # Header only libs header - +) +set(BOOST_LIBS_OPTIONAL # Compiled libs atomic chrono @@ -53,17 +54,24 @@ set(BOOST_LIBS serialization signals system - unit_test_framework + test thread timer type_erasure wave ) -foreach(lib ${BOOST_LIBS}) +foreach(lib ${BOOST_LIBS_REQUIRED}) include("libs/${lib}.cmake") endforeach() +foreach(lib ${BOOST_LIBS_OPTIONAL}) + # In case only a subset of modules is available (eg. after using bcp) + if(EXISTS "${BOOST_SOURCE}/libs/${lib}") + include("libs/${lib}.cmake") + endif() +endforeach() + # TODO: Move those to option() calls in the right file if(NOT BOOST_STANDALONE) # Compilation options required by all platforms diff --git a/libs/unit_test_framework.cmake b/libs/test.cmake similarity index 100% rename from libs/unit_test_framework.cmake rename to libs/test.cmake