From 7f69508eacf80db039c0c1b343748f9f0d5ac1ac Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Jan 2019 00:09:56 +0200 Subject: [PATCH] Add CMakeLists.txt --- CMakeLists.txt | 28 +++++++++++++++ test/cmake_subdir_test/CMakeLists.txt | 49 +++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 test/cmake_subdir_test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..01de5f5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright 2019 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +# Partial (add_subdirectory only) and experimental CMake support +# Subject to change; please do not rely on the contents of this file yet + +cmake_minimum_required(VERSION 3.5) +project(BoostFunction LANGUAGES CXX) + +add_library(boost_function INTERFACE) +add_library(Boost::function ALIAS boost_function) + +target_include_directories(boost_function INTERFACE include) + +target_link_libraries(boost_function + INTERFACE + Boost::assert + Boost::bind + Boost::config + Boost::core + Boost::integer + Boost::preprocessor + Boost::throw_exception + Boost::type_index + Boost::type_traits + Boost::typeof +) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt new file mode 100644 index 0000000..e27bcb2 --- /dev/null +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -0,0 +1,49 @@ +# Copyright 2018, 2019 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +cmake_minimum_required(VERSION 3.5) + +project(cmake_subdir_test LANGUAGES CXX) + +add_subdirectory(../.. boostorg/function) + +# boost_add_subdir + +function(boost_add_subdir name) + + add_subdirectory(../../../${name} boostorg/${name}) + +endfunction() + +# primary dependencies + +boost_add_subdir(assert) +boost_add_subdir(bind) +boost_add_subdir(config) +boost_add_subdir(core) +boost_add_subdir(integer) +boost_add_subdir(preprocessor) +boost_add_subdir(throw_exception) +boost_add_subdir(type_index) +boost_add_subdir(type_traits) +boost_add_subdir(typeof) + +# secondary dependencies + +boost_add_subdir(static_assert) +boost_add_subdir(container_hash) +boost_add_subdir(smart_ptr) +boost_add_subdir(detail) +boost_add_subdir(move) +boost_add_subdir(predef) + +# --target check + +add_executable(quick ../quick.cpp) +target_link_libraries(quick Boost::function Boost::core) + +enable_testing() +add_test(quick quick) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $)