-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
CMakeLists.txt
57 lines (45 loc) · 1.25 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
cmake_minimum_required(VERSION 3.14)
project(
refl-cpp
VERSION 0.12.1
DESCRIPTION "A modern compile-time reflection library for C++ with support for overloads, templates, attributes and proxies"
HOMEPAGE_URL "https://github.com/veselink1/refl-cpp"
LANGUAGES CXX
)
include(cmake/in-source-guard.cmake)
include(cmake/variables.cmake)
# ---- Declare library ----
add_library(refl-cpp INTERFACE)
add_library(refl-cpp::refl-cpp ALIAS refl-cpp)
target_include_directories(
refl-cpp
${refl-cpp_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
target_compile_features(refl-cpp INTERFACE cxx_std_17)
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -pedantic)
endif()
# ---- Install ----
include(cmake/install-rules.cmake)
# ---- Developer mode ----
if(NOT refl-cpp_DEVELOPER_MODE)
return()
elseif(NOT PROJECT_IS_TOP_LEVEL)
message(AUTHOR_WARNING "Developer mode is for developers of refl-cpp")
endif()
include(CTest)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
option(BUILD_EXAMPLES "Build the examples tree." ON)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
option(BUILD_BENCHES "Build the bench tree." OFF)
if(BUILD_BENCHES)
add_subdirectory(bench)
endif()