-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
77 lines (61 loc) · 1.89 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
68
69
70
71
72
73
74
75
76
77
cmake_minimum_required(VERSION 3.14)
include(cmake/prelude.cmake)
project(
cpp-toolbox-new
VERSION 0.1.0
DESCRIPTION "A tools box library for accelerating cpp programe developing."
HOMEPAGE_URL "https://github.com/nerdneilsfield/cpp-toolbox"
LANGUAGES CXX
)
include(cmake/project-is-top-level.cmake)
include(cmake/variables.cmake)
# ---- Declare library ----
add_library(
cpp-toolbox-new_cpp-toolbox-new
source/cpp-toolbox-new.cpp
)
add_library(cpp-toolbox-new::cpp-toolbox-new ALIAS cpp-toolbox-new_cpp-toolbox-new)
include(GenerateExportHeader)
generate_export_header(
cpp-toolbox-new_cpp-toolbox-new
BASE_NAME cpp-toolbox-new
EXPORT_FILE_NAME export/cpp-toolbox-new/cpp-toolbox-new_export.hpp
CUSTOM_CONTENT_FROM_VARIABLE pragma_suppress_c4251
)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(cpp-toolbox-new_cpp-toolbox-new PUBLIC CPP_TOOLBOX_NEW_STATIC_DEFINE)
endif()
set_target_properties(
cpp-toolbox-new_cpp-toolbox-new PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN YES
VERSION "${PROJECT_VERSION}"
SOVERSION "${PROJECT_VERSION_MAJOR}"
EXPORT_NAME cpp-toolbox-new
OUTPUT_NAME cpp-toolbox-new
)
target_include_directories(
cpp-toolbox-new_cpp-toolbox-new ${warning_guard}
PUBLIC
"\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
target_include_directories(
cpp-toolbox-new_cpp-toolbox-new SYSTEM
PUBLIC
"\$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/export>"
)
target_compile_features(cpp-toolbox-new_cpp-toolbox-new PUBLIC cxx_std_17)
# ---- Install rules ----
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/install-rules.cmake)
endif()
# ---- Developer mode ----
if(NOT cpp-toolbox-new_DEVELOPER_MODE)
return()
elseif(NOT PROJECT_IS_TOP_LEVEL)
message(
AUTHOR_WARNING
"Developer mode is intended for developers of cpp-toolbox-new"
)
endif()
include(cmake/dev-mode.cmake)