forked from HowardHinnant/date
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
31 lines (24 loc) · 1.11 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.2.2)
set(LIBRARY_NAME date)
project(${LIBRARY_NAME} LANGUAGES CXX)
set(MAJOR_VERSION 2)
set(MINOR_VERSION 1)
set(PATCH_VERSION 0)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Let user override the used C++ standard by using the command line with
# cmake -DCMAKE_CXX_STANDARD=11 ..
# (CAVEAT: will fail on constexpr bool islamic::year::is_leap() const if < 14)
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
################################################################################
# Add the header-only library
add_library(${LIBRARY_NAME} INTERFACE)
target_include_directories(${LIBRARY_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # for headers when building
$<INSTALL_INTERFACE:include/${LIBRARY_NAME}> # for client in install mode
)
# This CMake configuration was and its future versions will be partially inspired by
# - https://rix0r.nl/blog/2015/08/13/cmake-guide/
# - https://vittorioromeo.info/index/blog/2016_cpp_library_configuration_api.html
# - https://steveire.wordpress.com/2016/08/09/opt-in-header-only-libraries-with-cmake/