-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (53 loc) · 1.46 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
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.21)
project(serialize)
if (PROJECT_IS_TOP_LEVEL)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin-lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin-etc")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED)
option(
FOX_SERIALIZE_BUILD_SAMPLES
"If samples are built."
ON
)
option(
FOX_SERIALIZE_BUILD_TESTS
"If unit tests are built"
ON
)
else()
option(
FOX_SERIALIZE_BUILD_SAMPLES
"If samples are built."
OFF
)
option(
FOX_SERIALIZE_BUILD_TESTS
"If unit tests are built"
OFF
)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_NOT_SUPPORTED_ERROR LANGUAGES CXX)
if(NOT ${IPO_SUPPORTED})
message(STATUS "IPO / LTO not supported: <${IPO_NOT_SUPPORTED_ERROR}>")
else()
message(STATUS "IPO / LTO supported.")
endif()
option(
FOX_SERIALIZE_INCLUDE_REFLEXPR
"If RedSkittleFox::reflexpr should be used for aggregate types."
ON
)
include(FetchContent)
add_subdirectory("include")
add_library(fox::serialize ALIAS serialize)
if (FOX_SERIALIZE_BUILD_SAMPLES)
add_subdirectory("sample")
endif()
if (FOX_SERIALIZE_BUILD_TESTS)
add_subdirectory("test")
endif()