-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
60 lines (47 loc) · 1.57 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# MPark.Format
#
# Copyright Michael Park, 2014-2017
#
# 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)
cmake_minimum_required(VERSION 3.6.3)
project(MPark.Format VERSION 1.0.0 LANGUAGES CXX)
# Option.
option(MPARK_FORMAT_INCLUDE_TESTS "Build tests." OFF)
# Target.
add_library(mpark_format INTERFACE)
target_include_directories(mpark_format INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
# Config.
include(CMakePackageConfigHelpers)
configure_package_config_file(
cmake/mpark_format-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cmake/mpark_format-config.cmake"
INSTALL_DESTINATION lib/cmake/mpark_format
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/cmake/mpark_format-config-version.cmake"
COMPATIBILITY AnyNewerVersion)
# Export.
export(
TARGETS mpark_format
FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/mpark_format-targets.cmake")
# Install.
install(TARGETS mpark_format EXPORT mpark_format)
install(
EXPORT mpark_format
FILE mpark_format-targets.cmake
DESTINATION lib/cmake/mpark_format)
install(DIRECTORY include/mpark DESTINATION include)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/cmake/mpark_format-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/mpark_format-config-version.cmake"
DESTINATION lib/cmake/mpark_format)
if(MPARK_FORMAT_INCLUDE_TESTS)
enable_testing()
add_subdirectory(3rdparty/googletest/googletest)
add_subdirectory(test)
endif()