-
Notifications
You must be signed in to change notification settings - Fork 33
/
CMakeLists.txt
81 lines (59 loc) · 1.99 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
79
80
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 - 2024 Alexander Shaduri <[email protected]>
###############################################################################
# 3.14 for proper object library support (wrt linking)
cmake_minimum_required(VERSION 3.14)
# Use new policy for option() to supress warnings.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
include(${CMAKE_SOURCE_DIR}/version.txt)
project(gsmartcontrol
VERSION ${CMAKE_PROJECT_VERSION}
DESCRIPTION "Hard Disk Drive and SSD Health Inspection Tool"
HOMEPAGE_URL "https://gsmartcontrol.shaduri.dev"
LANGUAGES CXX
)
# Provide DATADIR, etc.
include(GNUInstallDirs)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
include(src/build_config/compiler_options.cmake)
# Disable RPATH manipulation, we don't have shared libraries
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
# Write the binaries to project root (avoids conflicts with manifests, also it's more convenient this way)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
# User-controlled build options
option(APP_BUILD_EXAMPLES "Build examples" OFF)
option(APP_BUILD_TESTS "Build tests" OFF)
# Install documentation
set(DOC_FILES
LICENSE.LGPL3.txt
LICENSE.txt
NEWS.txt
README.md
)
if (WIN32)
install(FILES ${DOC_FILES} DESTINATION doc/)
install(DIRECTORY docs DESTINATION doc/
PATTERN "*.yml" EXCLUDE
PATTERN "CNAME" EXCLUDE
)
else()
install(FILES ${DOC_FILES} TYPE DOC)
install(DIRECTORY docs TYPE DOC
PATTERN "*.yml" EXCLUDE
PATTERN "CNAME" EXCLUDE
)
endif()
# CTest support
include(CTest)
#include(${CMAKE_SOURCE_DIR}/dependencies/catch2/Catch2/extras/Catch.cmake)
include(${CMAKE_SOURCE_DIR}/dependencies/catch2/Catch2/contrib/Catch.cmake)
add_subdirectory(contrib)
add_subdirectory(data)
add_subdirectory(dependencies)
add_subdirectory(packaging)
add_subdirectory(src)
# Packaging support
include(packaging/cpack_options.cmake)