-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
89 lines (66 loc) · 3.1 KB
/
CMakeLists.txt
File metadata and controls
89 lines (66 loc) · 3.1 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
#==============================================================================
# nfx-stringutils - Top-level CMake configuration
#==============================================================================
#----------------------------------------------
# Project definition
#----------------------------------------------
cmake_minimum_required(VERSION 3.20)
project(nfx-stringutils
VERSION 0.7.0
DESCRIPTION "Modern C++20 header-only library providing high-performance string utilities and zero-allocation splitting"
HOMEPAGE_URL "https://github.com/nfx-libs/nfx-stringutils"
LANGUAGES CXX
)
#----------------------------------------------
# Installation prefix configuration
#----------------------------------------------
include(GNUInstallDirs)
#----------------------------------------------
# Version configuration
#----------------------------------------------
set(NFX_STRINGUTILS_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} CACHE INTERNAL "nfx-stringutils major version")
set(NFX_STRINGUTILS_VERSION_MINOR ${PROJECT_VERSION_MINOR} CACHE INTERNAL "nfx-stringutils minor version")
set(NFX_STRINGUTILS_VERSION_PATCH ${PROJECT_VERSION_PATCH} CACHE INTERNAL "nfx-stringutils patch version")
set(NFX_STRINGUTILS_VERSION ${PROJECT_VERSION} CACHE INTERNAL "nfx-stringutils version")
#----------------------------------------------
# Project metadata
#----------------------------------------------
set(NFX_STRINGUTILS_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
#----------------------------------------------
# Testing setup
#----------------------------------------------
enable_testing()
#----------------------------------------------
# Build options
#----------------------------------------------
# --- Build components (header-only library) ---
option(NFX_STRINGUTILS_BUILD_TESTS "Build tests" OFF)
option(NFX_STRINGUTILS_BUILD_SAMPLES "Build samples" OFF)
option(NFX_STRINGUTILS_BUILD_BENCHMARKS "Build benchmarks" OFF)
option(NFX_STRINGUTILS_BUILD_DOCUMENTATION "Build Doxygen documentation" OFF)
# --- Installation ---
option(NFX_STRINGUTILS_INSTALL_PROJECT "Install project" OFF)
# --- Packaging ---
option(NFX_STRINGUTILS_PACKAGE_SOURCE "Enable source package generation" OFF)
#----------------------------------------------
# CMake modules configuration
#----------------------------------------------
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
#----------------------------------------------
# Main configuration
#----------------------------------------------
include(nfxStringUtilsBuildConfig)
include(nfxStringUtilsDependencies)
include(nfxStringUtilsTarget)
#----------------------------------------------
# Installation and packaging
#----------------------------------------------
include(nfxStringUtilsInstall)
include(nfxStringUtilsPackaging)
#----------------------------------------------
# Targets
#----------------------------------------------
add_subdirectory(test)
add_subdirectory(samples)
add_subdirectory(benchmark)
add_subdirectory(doc)