• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 Mike Dev
2# Distributed under the Boost Software License, Version 1.0.
3# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
4
5cmake_minimum_required(VERSION 3.5)
6# NOTE: Individual boost cmake files might require a higher cmake version
7
8project(boost LANGUAGES CXX)
9
10#=== options ===
11
12# Some libraries' cmake files don't work well with this cmake file, e.g. because
13# - they are generally not designed to support the add_subdirectory workflow at all
14# - they define targets with conflicting names (e.g. check)
15# - require some additional (internal or external) dependencies
16#
17# Those libraries can be excluded here
18set(BOOST_RATIO_IGNORE_LIBS callable_traits;hof;compute;gil;hana;yap;safe_numerics;beast CACHE STRING "List of libraries that will be excluded from cmake build")
19
20
21#~~~ options ~~~
22message(STATUS "[Boost] Excluded libs (BOOST_RATIO_IGNORE_LIBS): ${BOOST_RATIO_IGNORE_LIBS}")
23
24# cmake doesn't require autolinking and currently most cmake files don't produce
25# name mangled libraries anyway
26add_definitions(-DBOOST_ALL_NO_LIB)
27enable_testing()
28
29# Detect and process all CMakeLists files that reside in the root folder of a library
30file(GLOB boost_libs_with_cmake_files ../../../../libs/*/CMakeLists.txt)
31
32foreach(cmake_file IN LISTS boost_libs_with_cmake_files)
33
34    get_filename_component(dir ${cmake_file} DIRECTORY)
35    get_filename_component(lib_name ${dir} NAME)
36    if(NOT lib_name IN_LIST BOOST_RATIO_IGNORE_LIBS)
37        add_subdirectory(${dir} ${lib_name})
38    endif()
39
40endforeach()