2019-12-21 16:28:12 +02:00
|
|
|
# Copyright 2018, 2019 Peter Dimov
|
2018-09-28 17:55:52 +03:00
|
|
|
# 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
|
|
|
|
|
2022-07-04 19:41:47 +02:00
|
|
|
if(NOT DEFINED IDF_TARGET)
|
|
|
|
|
2019-12-21 01:18:26 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5...3.16)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2022-04-14 14:14:13 +03:00
|
|
|
project(boost_mp11 VERSION 1.80.0 LANGUAGES CXX)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
|
|
|
add_library(boost_mp11 INTERFACE)
|
|
|
|
add_library(Boost::mp11 ALIAS boost_mp11)
|
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
target_include_directories(boost_mp11 INTERFACE include)
|
2018-09-29 00:15:53 +03:00
|
|
|
target_compile_features(boost_mp11 INTERFACE cxx_alias_templates cxx_variadic_templates cxx_decltype)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
|
|
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
# Fetch support files
|
2019-12-21 01:18:26 +02:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
message(STATUS "Fetching BoostFetch.cmake")
|
2019-12-27 03:46:56 +02:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
file(DOWNLOAD
|
|
|
|
"https://raw.githubusercontent.com/boostorg/cmake/develop/include/BoostFetch.cmake"
|
|
|
|
"${CMAKE_BINARY_DIR}/fetch_and_include/BoostFetch.cmake"
|
|
|
|
)
|
2019-12-27 03:46:56 +02:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
include("${CMAKE_BINARY_DIR}/fetch_and_include/BoostFetch.cmake")
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
boost_fetch(boostorg/cmake TAG develop NO_ADD_SUBDIR)
|
2019-12-22 03:08:58 +02:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
FetchContent_GetProperties(boostorg_cmake)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${boostorg_cmake_SOURCE_DIR}/include)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2021-10-08 16:29:40 +03:00
|
|
|
# Testing (off by default)
|
2018-10-09 06:08:08 +03:00
|
|
|
|
2021-10-08 16:29:40 +03:00
|
|
|
option(BUILD_TESTING "Build the tests." OFF)
|
2019-12-27 03:50:12 +02:00
|
|
|
include(CTest)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
if(BUILD_TESTING)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
set(BUILD_TESTING OFF) # hide cache variable
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
boost_fetch(boostorg/assert TAG develop EXCLUDE_FROM_ALL)
|
|
|
|
boost_fetch(boostorg/config TAG develop EXCLUDE_FROM_ALL)
|
|
|
|
boost_fetch(boostorg/core TAG develop EXCLUDE_FROM_ALL)
|
2021-10-28 22:35:00 +03:00
|
|
|
boost_fetch(boostorg/static_assert TAG develop EXCLUDE_FROM_ALL)
|
|
|
|
boost_fetch(boostorg/throw_exception TAG develop EXCLUDE_FROM_ALL)
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
unset(BUILD_TESTING)
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
endif()
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2020-03-22 20:17:39 +02:00
|
|
|
# Do not use the default BoostInstall versioned layout on Windows when standalone
|
|
|
|
set(BOOST_INSTALL_LAYOUT "system" CACHE STRING "Installation layout (versioned, tagged, or system)")
|
|
|
|
|
2021-10-08 16:22:09 +03:00
|
|
|
include(BoostInstall)
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
boost_install(TARGETS boost_mp11 HEADER_DIRECTORY include/)
|
2018-09-30 21:49:46 +03:00
|
|
|
|
2018-09-28 17:55:52 +03:00
|
|
|
endif()
|
|
|
|
|
2019-12-21 01:18:26 +02:00
|
|
|
if(BUILD_TESTING)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
2019-12-27 03:50:12 +02:00
|
|
|
add_subdirectory(test)
|
2018-09-28 17:55:52 +03:00
|
|
|
|
|
|
|
endif()
|
2022-07-04 19:41:47 +02:00
|
|
|
|
|
|
|
else()
|
|
|
|
|
2022-07-05 10:48:23 +02:00
|
|
|
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
|
|
|
|
|
2022-07-04 19:41:47 +02:00
|
|
|
idf_component_register(
|
2022-07-05 10:48:23 +02:00
|
|
|
SRCS
|
|
|
|
${headers}
|
2022-07-04 19:41:47 +02:00
|
|
|
INCLUDE_DIRS
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|