-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
79 lines (64 loc) · 3.8 KB
/
CMakeLists.txt
File metadata and controls
79 lines (64 loc) · 3.8 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
# ___ ___ ___ _ _ _ _ _____ ___ ___ ___
# ( _`\ ( _`\ ( _`\ ( ) ( )( ) _ ( )( _ )| _`\ ( _`\ ( _`\.
# | ( (_)| |_) )| |_) ) | |/'/'| | ( ) | || (_) || (_) )| ( (_)| (_(_)
# | | _ | ,__/'| ,__/' | , < | | | | | || _ || , / | |___ `\__ \.
# | (_( )| | | | | |\`\ | (_/ \_) || | | || |\ \ | (_, )( )_) |
# (____/'(_) (_) (_) (_)`\___x___/'(_) (_)(_) (_)(____/'`\____)
#
# https://github.com/huanhuanonly/cpp-kwargs
#
# Copyright (c) 2024-2025 Yang Huanhuan (3347484963@qq.com).
#
# Before using this file, please read its license:
#
# https://github.com/huanhuanonly/cpp-kwargs/blob/main/LICENSE
#
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED. THE AUTHOR RESERVES THE RIGHT TO MODIFY THE
# LICENSE OF THIS FILE AT ANY TIME.
cmake_minimum_required (VERSION 3.8)
include_directories ("include/")
option (KWARGS_KEY_CASE_INSENSITIVE "Enable case-insensitivity for KwargsKey" OFF)
option (KWARGS_USE_LITERAL_SUFFIX_NO_UNDERSCORE "Enable literal suffixes without leading underscores" OFF)
option (KWARGS_USE_SHORT_LITERAL_SUFFIX "Enable short literal suffix" OFF)
option (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_HEURISTIC_PRECISION "Enable heuristic precision adjustment when converting floating point numbers to strings" OFF)
if (KWARGS_KEY_CASE_INSENSITIVE)
add_compile_definitions (KWARGS_KEY_CASE_INSENSITIVE)
endif()
if (KWARGS_USE_LITERAL_SUFFIX_NO_UNDERSCORE)
add_compile_definitions (KWARGS_USE_LITERAL_SUFFIX_NO_UNDERSCORE)
endif()
if (KWARGS_USE_SHORT_LITERAL_SUFFIX)
add_compile_definitions (KWARGS_USE_SHORT_LITERAL_SUFFIX)
endif()
if (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_HEURISTIC_PRECISION)
add_compile_definitions (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_HEURISTIC_PRECISION)
endif()
if (DEFINED KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_PRECISION)
add_compile_definitions (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_PRECISION=${KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_PRECISION})
endif()
if (DEFINED KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_FLOAT_PRECISION)
add_compile_definitions (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_FLOAT_PRECISION=${KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_FLOAT_PRECISION})
endif()
if (DEFINED KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_DOUBLE_PRECISION)
add_compile_definitions (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_DOUBLE_PRECISION=${KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_DOUBLE_PRECISION})
endif()
if (DEFINED KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_LONG_DOUBLE_PRECISION)
add_compile_definitions (KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_LONG_DOUBLE_PRECISION=${KWARGS_CONVERT_REALS_TO_STRINGS_WITH_FIXED_LONG_DOUBLE_PRECISION})
endif()
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message (STATUS "cpp-kwargs: [testing...].")
include (CTest)
enable_testing ()
add_subdirectory ("tests/")
else()
message (STATUS "cpp-kwargs: [included].")
endif()
# _ _ _ #
# ( ) ( ) (_ ) #
# | |__ _ _ _ _ ___ | |__ _ _ _ _ ___ _ ___ | | _ _ #
# | _ `\( ) ( ) /'_` )/' _ `\| _ `\( ) ( ) /'_` )/' _ `\ /'_`\ /' _ `\ | | ( ) ( ) #
# | | | || (_) |( (_| || ( ) || | | || (_) |( (_| || ( ) |( (_) )| ( ) | | | | (_) | #
# (_) (_)`\___/'`\__,_)(_) (_)(_) (_)`\___/'`\__,_)(_) (_)`\___/'(_) (_)(___)`\__, | #
# https://github.com/huanhuanonly ( )_| | #
# `\___/' #