-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
78 lines (69 loc) · 2.91 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
78
cmake_minimum_required(VERSION 3.19)
project(
cppproperties
VERSION 0.1.0
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/tectu/cppproperties"
)
# User options
option(CPPPROPERTIES_BUILD_EXAMPLES "Whether to build examples." ON)
option(CPPPROPERTIES_BUILD_TESTS "Whether to build tests." ON)
option(CPPPROPERTIES_ENABLE_BOOST "Whether to enable built-in support for common boost types." OFF)
option(CPPPROPERTIES_ENABLE_QT "Whether to enable built-in support for Qt types." OFF)
option(CPPPROPERTIES_ENABLE_QT_WIDGETS "Whether to enable built-in support for Qt widgets." OFF)
option(CPPPROPERTIES_ENABLE_JSON "Whether to enable JSON (de)serialization." ON)
option(CPPPROPERTIES_ENABLE_XML "Whether to enable XML (de)serialization." ON)
option(CPPPROPERTIES_ENABLE_GPDS "Whether to enable GPDS (de)serialization." OFF)
option(CPPPROPERTIES_PERFORM_CPPCHECK "Whether to run cppcheck." OFF)
# Include examples (if supposed to)
if (CPPPROPERTIES_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Add the actual library
add_subdirectory(cppproperties)
# Add tests
if (CPPPROPERTIES_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
if (CPPPROPERTIES_PERFORM_CPPCHECK)
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
if (CMAKE_CXX_CPPCHECK)
list(
APPEND CMAKE_CXX_CPPCHECK
"--enable=warning"
"--inconclusive"
"--force"
"--inline-suppr"
"--suppressions-list=${CMAKE_SOURCE_DIR}/CppCheckSuppressions.txt"
)
endif()
endif()
# Print some information
message(STATUS "----------------------------")
message(STATUS "cpp-properties configuration")
message(STATUS "")
message(STATUS "Build:")
message(STATUS " Examples : " ${CPPPROPERTIES_BUILD_EXAMPLES})
message(STATUS " Tests : " ${CPPPROPERTIES_BUILD_TESTS})
message(STATUS "")
message(STATUS "Types:")
message(STATUS " Boost : " ${CPPPROPERTIES_ENABLE_BOOST})
message(STATUS " Qt : " ${CPPPROPERTIES_ENABLE_QT})
message(STATUS "")
message(STATUS "Serialization:")
message(STATUS " JSON : " ${CPPPROPERTIES_ENABLE_JSON})
message(STATUS " XML : " ${CPPPROPERTIES_ENABLE_XML})
message(STATUS " GPDS : " ${CPPPROPERTIES_ENABLE_GPDS})
message(STATUS "")
message(STATUS "GUI Elements:")
message(STATUS " Qt : " ${CPPPROPERTIES_ENABLE_QT_WIDGETS})
message(STATUS "----------------------------")
################################################################################
# CPack #
################################################################################
set(CPACK_PACKAGE_VENDOR "Joel Bodenmann")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A library to bring a property system to modern C++.")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/readme.md")
include(CPack)