Add CMake install support (required for dependencies to have one)

This commit is contained in:
Peter Dimov
2019-12-28 17:23:00 +02:00
parent 73d7b4f66f
commit d52ab32466

View File

@ -20,12 +20,13 @@
# Only need the basic minimum of project, add_library, and # Only need the basic minimum of project, add_library, and
# target_include_directories commands. # target_include_directories commands.
cmake_minimum_required( VERSION 3.0 ) # We support 3.0, but prefer 3.16 policies and behavior
cmake_minimum_required( VERSION 3.0...3.16 )
# Don't set VERSION, as that's a pita to keep up to date with the version # Keep VERSION empty when outside the superproject, as that's a pita to
# header. And don't set LANGUAGES as we are multi-language and header # keep up to date with the version header. And don't set LANGUAGES as we
# only, so it's irrelevant. # are multi-language and header only, so it's irrelevant.
project( BoostPredef ) project( BoostPredef VERSION "${BOOST_SUPERPROJECT_VERSION}" )
# Simple INTERFACE, and header only, library target. # Simple INTERFACE, and header only, library target.
add_library( boost_predef INTERFACE ) add_library( boost_predef INTERFACE )
@ -36,3 +37,10 @@ target_include_directories( boost_predef INTERFACE include )
# Add an alias to be compatible with consumers that may have used the # Add an alias to be compatible with consumers that may have used the
# FindBoost script. # FindBoost script.
add_library( Boost::predef ALIAS boost_predef ) add_library( Boost::predef ALIAS boost_predef )
if(BOOST_SUPERPROJECT_VERSION)
include(BoostInstall)
boost_install(TARGETS boost_predef HEADER_DIRECTORY include/)
endif()