From 38b658648e9cdef8254d02ea9b68f85d39d7fc52 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 22 Dec 2019 04:22:06 +0200 Subject: [PATCH 1/2] Update CMakeLists.txt with install support --- CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09fec397..12b473bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,27 @@ # # IT IS HIGHLY LIKELY THAT THIS FILE WILL CHANGE WITHOUT NOTICE!!! # -# DO NOT REPLY ON THE CONTENTS OF THIS FILE!!! +# DO NOT RELY ON THE CONTENTS OF THIS FILE!!! # -cmake_minimum_required(VERSION 3.5) -project(BoostConfig LANGUAGES CXX) +cmake_minimum_required(VERSION 3.5...3.16) +project(boost_config VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) add_library(boost_config INTERFACE) add_library(Boost::config ALIAS boost_config) -target_include_directories(boost_config INTERFACE include) +set_property(TARGET boost_config PROPERTY EXPORT_NAME config) + +target_include_directories(boost_config + INTERFACE + $ + $ +) + +include(BoostInstall OPTIONAL RESULT_VARIABLE HAVE_BOOST_INSTALL) + +if(HAVE_BOOST_INSTALL) + + boost_install(boost_config) + +endif() From 6d06a1471bbd6346dd8fb4e98b9b4a72381bd9c1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 22 Dec 2019 08:35:51 +0200 Subject: [PATCH 2/2] Install the include/ directory separately --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12b473bc..bb9f3493 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,8 @@ include(BoostInstall OPTIONAL RESULT_VARIABLE HAVE_BOOST_INSTALL) if(HAVE_BOOST_INSTALL) + install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + boost_install(boost_config) endif()