1 # Copyright 2018 Mike Dev
2 # Copyright 2018 Peter Dimov
3 # Distributed under the Boost Software License, Version 1.0.
4 # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
6 # Partial (add_subdirectory only) and experimental CMake support
7 # Subject to change; please do not rely on the contents of this file yet
9 cmake_minimum_required(VERSION 3.5)
11 project(BoostAssert VERSION 1.72.0 LANGUAGES CXX)
13 add_library(boost_assert INTERFACE)
14 add_library(Boost::assert ALIAS boost_assert)
16 target_include_directories(boost_assert INTERFACE include)
18 target_link_libraries(boost_assert
23 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
25 # `function` confuses FetchContent, sees empty CMAKE_CURRENT_LIST_DIR
26 macro(fetch_and_include name)
28 message(STATUS "Fetching ${name}")
31 "https://raw.githubusercontent.com/pdimov/mincmake/master/${name}"
32 "${CMAKE_BINARY_DIR}/fetch_and_include/${name}"
35 include("${CMAKE_BINARY_DIR}/fetch_and_include/${name}")
39 fetch_and_include(cmake/boost_fetch.cmake)
40 fetch_and_include(cmake/boost_test.cmake)
42 boost_fetch(boostorg/config TAG develop)
43 boost_fetch(boostorg/core TAG develop)
46 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
50 if(COMMAND boost_test)
52 add_subdirectory(test)