-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
84 lines (67 loc) · 2.42 KB
/
Copy pathCMakeLists.txt
File metadata and controls
84 lines (67 loc) · 2.42 KB
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
81
82
83
84
cmake_minimum_required(VERSION 3.15)
################################################################################
#
# Project definition
#
################################################################################
# Define the project
project(masscalculator-cli
VERSION 0.1.0
HOMEPAGE_URL "https://github.com/MassCalculator/masscalculator-cli"
DESCRIPTION "masscalculator-cli executable"
LANGUAGES CXX
)
# Set C and C++ standards
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Set the project version.
set(MASSCALCULATOR_CLI_NAME ${PROJECT_NAME})
set(MASSCALCULATOR_CLI_VERSION ${PROJECT_VERSION})
set(MASSCALCULATOR_CLI_MAJOR ${PROJECT_VERSION_MAJOR})
set(MASSCALCULATOR_CLI_MINOR ${PROJECT_VERSION_MINOR})
set(MASSCALCULATOR_CLI_PATCH ${PROJECT_VERSION_PATCH})
################################################################################
#
# Additional CMake functionalities
#
################################################################################
# Additional CMake modules are added here to allow finding libraries not
# natively supported by CMake and to be able to include CMake files
# uder third_party/ redirectly.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/third_party"
)
# Initialize the package manager.
include(conan)
# Search for all third party dependencies
include(third_party)
################################################################################
#
# CMake targets definition
#
################################################################################
if(${BUILD_DOCS})
# This adds the doxygen documentation.
add_subdirectory(docs)
endif()
# This adds the executables for this project.
add_subdirectory(executables)
# This adds the compile flags.
target_compile_options(${PROJECT_NAME} PRIVATE -O2 -Wall -Wextra -Werror)
# This adds the linker flags.
target_link_options(${PROJECT_NAME} PRIVATE -flto)
################################################################################
#
# Installation and Deployment
#
################################################################################
include(install)
# This adds the packaging steps.
# @todo(jimmyhalimi): Commented out for now, until time comes to fix this.
# include(pack-cpack)
if(${BUILD_RELEASE})
# @todo(jimmyhalimi): Commented out for now, until time comes to fix this.
# include(deploy)
endif()