From e3590d89af6ebd99d8900d778921c96e40b3388f Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Tue, 2 Oct 2018 21:33:32 +0200 Subject: [PATCH 1/3] [CMake] Add minimal cmake file Generate cmake target that builds the library and which can be used by other libraries to express their dependency on this library and retrieve any configuration information such as the include directory, binary to link to, transitive dependencies, necessary compiler options or the required c++ standards level. --- CMakeLists.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..29d8424 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 2018 Mike Dev +# 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 +# +# NOTE: CMake support for Boost.Exception is currently experimental at best +# and the interface is likely to change in the future + +cmake_minimum_required(VERSION 3.5) +project(BoostException LANGUAGES CXX) + + +add_library(boost_exception src/clone_current_exception_non_intrusive.cpp) +add_library(Boost::exception ALIAS boost_exception) + +target_include_directories(boost_exception PUBLIC include) + +target_link_libraries(boost_exception + PUBLIC + Boost::assert + Boost::config + Boost::core + Boost::smart_ptr + Boost::throw_exception + Boost::tuple + Boost::type_traits +) + From f4e1a11e6b90ca49b07ddb1515ccc79418928b0c Mon Sep 17 00:00:00 2001 From: Mike-Devel Date: Sat, 2 Mar 2019 14:20:29 +0100 Subject: [PATCH 2/3] [CMake] Treat Boost.Exception as header only --- CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29d8424..3db488d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,24 @@ # Copyright 2018 Mike Dev # 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 +# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt # # NOTE: CMake support for Boost.Exception is currently experimental at best # and the interface is likely to change in the future -cmake_minimum_required(VERSION 3.5) -project(BoostException LANGUAGES CXX) +cmake_minimum_required( VERSION 3.5 ) +project( BoostException LANGUAGES CXX ) +# We treat Boost.Exception as header only for now. +# See https://github.com/boostorg/exception/pull/17 +# for more information. -add_library(boost_exception src/clone_current_exception_non_intrusive.cpp) -add_library(Boost::exception ALIAS boost_exception) +add_library( boost_exception INTERFACE ) +add_library( Boost::exception ALIAS boost_exception ) -target_include_directories(boost_exception PUBLIC include) +target_include_directories( boost_exception PUBLIC include ) -target_link_libraries(boost_exception - PUBLIC +target_link_libraries( boost_exception + INTERFACE Boost::assert Boost::config Boost::core From 8d19f99e43903f0476c28b9d85f0cf78debd2060 Mon Sep 17 00:00:00 2001 From: Mike-Devel Date: Sat, 2 Mar 2019 14:24:52 +0100 Subject: [PATCH 3/3] [CMake] Fix copyright date --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3db488d..abde781 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2018 Mike Dev +# Copyright 2019 Mike Dev # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt #