-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
126 lines (107 loc) · 3.12 KB
/
Copy pathCMakeLists.txt
File metadata and controls
126 lines (107 loc) · 3.12 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.30...4.3)
include(infra/cmake/enable-experimental-import-std.cmake)
project(
beman.utf_view
DESCRIPTION "C++29 UTF Transcoding Views"
LANGUAGES CXX
VERSION 0.3.0
)
# [CMAKE.SKIP_TESTS]
option(
BEMAN_UTF_VIEW_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)
# [CMAKE.SKIP_EXAMPLES]
option(
BEMAN_UTF_VIEW_BUILD_EXAMPLES
"Enable building examples. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)
option(
BEMAN_UTF_VIEW_USE_MODULES
"Provide beman.transform_view as a C++ module"
OFF
)
if(BEMAN_UTF_VIEW_USE_MODULES)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
endif()
configure_file(
"${PROJECT_SOURCE_DIR}/include/beman/utf_view/config_generated.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/utf_view/config_generated.hpp"
@ONLY
)
option(
BEMAN_UTF_VIEW_BUILD_PAPER
"Enable building paper. Default: OFF. Values: { ON, OFF }."
OFF
)
# for find of beman_install_library and configure_build_telemetry
include(infra/cmake/beman-install-library.cmake)
include(infra/cmake/BuildTelemetryConfig.cmake)
if(BEMAN_UTF_VIEW_USE_MODULES)
set(BEMAN_TRANSFORM_VIEW_USE_MODULES ON)
endif()
find_package(beman.transform_view REQUIRED)
if(BEMAN_UTF_VIEW_USE_MODULES)
add_library(beman.utf_view STATIC)
else()
add_library(beman.utf_view INTERFACE)
endif()
add_library(beman::utf_view ALIAS beman.utf_view)
if(BEMAN_UTF_VIEW_USE_MODULES)
target_sources(
beman.utf_view
PUBLIC
FILE_SET CXX_MODULES
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(beman.utf_view PROPERTIES CXX_MODULE_STD ON)
target_compile_features(beman.utf_view PUBLIC cxx_std_23)
else()
target_sources(
beman.utf_view
PUBLIC
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(
beman.utf_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
)
endif()
if(BEMAN_UTF_VIEW_USE_MODULES)
target_link_libraries(beman.utf_view PRIVATE beman::transform_view)
else()
target_link_libraries(beman.utf_view INTERFACE beman::transform_view)
endif()
add_subdirectory(include/beman/utf_view)
if(BEMAN_USE_FETCH_CONTENT_ENABLED)
beman_install_library(
beman.utf_view
TARGETS beman.utf_view beman.transform_view
)
else()
beman_install_library(
beman.utf_view
TARGETS beman.utf_view
DEPENDENCIES "[===[beman.transform_view]===]"
)
endif()
configure_build_telemetry()
if(BEMAN_UTF_VIEW_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/utf_view)
endif()
if(BEMAN_UTF_VIEW_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BEMAN_UTF_VIEW_BUILD_PAPER)
add_subdirectory(papers)
endif()