forked from boostorg/assert
Update CMake files
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
# Copyright 2018 Mike Dev
|
||||
# Copyright 2018 Peter Dimov
|
||||
# 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
|
||||
|
||||
# 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)
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(BoostAssert VERSION 1.72.0 LANGUAGES CXX)
|
||||
project(boost_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
add_library(boost_assert INTERFACE)
|
||||
add_library(Boost::assert ALIAS boost_assert)
|
||||
@@ -20,34 +19,7 @@ target_link_libraries(boost_assert
|
||||
Boost::config
|
||||
)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
|
||||
# `function` confuses FetchContent, sees empty CMAKE_CURRENT_LIST_DIR
|
||||
macro(fetch_and_include name)
|
||||
|
||||
message(STATUS "Fetching ${name}")
|
||||
|
||||
file(DOWNLOAD
|
||||
"https://raw.githubusercontent.com/pdimov/mincmake/master/${name}"
|
||||
"${CMAKE_BINARY_DIR}/fetch_and_include/${name}"
|
||||
)
|
||||
|
||||
include("${CMAKE_BINARY_DIR}/fetch_and_include/${name}")
|
||||
|
||||
endmacro()
|
||||
|
||||
fetch_and_include(cmake/boost_fetch.cmake)
|
||||
fetch_and_include(cmake/boost_test.cmake)
|
||||
|
||||
boost_fetch(boostorg/config TAG develop)
|
||||
boost_fetch(boostorg/core TAG develop)
|
||||
|
||||
enable_testing()
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
||||
endif()
|
||||
|
||||
if(COMMAND boost_test)
|
||||
if(BUILD_TESTING)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# Copyright 2018 Peter Dimov
|
||||
# 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
|
||||
|
||||
include(BoostTestJamfile)
|
||||
|
||||
boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::assert Boost::core)
|
||||
boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION} LIBRARIES Boost::core Boost::config)
|
||||
|
Reference in New Issue
Block a user