Disable installation without PROJECT_VERSION; add comments; fix indentation

This commit is contained in:
Peter Dimov
2019-12-27 04:00:29 +02:00
parent 9d8eda7972
commit da5e091413

View File

@@ -2,9 +2,7 @@
# 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 and experimental CMake support
# Subject to change; please do not rely on the contents of this file yet
# We support CMake 3.5, but prefer 3.16 policies and behavior
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -19,14 +17,18 @@ target_link_libraries(boost_assert
Boost::config
)
include(BoostInstall OPTIONAL RESULT_VARIABLE HAVE_BOOST_INSTALL)
# boost_install requires PROJECT_VERSION
# Without the superproject, we don't have any, so skip installation
if(HAVE_BOOST_INSTALL)
if(BOOST_SUPERPROJECT_VERSION)
include(BoostInstall)
boost_install(TARGETS boost_assert HEADER_DIRECTORY include/)
endif()
# BUILD_TESTING is the standard CTest variable that enables testing
if(BUILD_TESTING)
add_subdirectory(test)