-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
116 lines (91 loc) · 3.2 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Copyright 2019 Kai Pastor
#
# This file is part of OpenOrienteering.
#
# OpenOrienteering is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenOrienteering is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenOrienteering. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(CupCalculator VERSION 1.1.2 LANGUAGES CXX)
set(PROJECT_COPYRIGHT "(C) 2019 The OpenOrienteering developers")
set(PROJECT_VERSION_DISPLAY "${PROJECT_VERSION} ${CMAKE_BUILD_TYPE}" CACHE STRING
"Project version string to be displayed"
)
option(MAKE_BUNDLE "Install all runtime libraries and plugins" OFF)
# Packaging
set(CPACK_PACKAGE_NAME "OpenOrienteering ${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "OpenOrienteering")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cup scoring program from OpenOrienteering")
set(CPACK_PACKAGE_FILE_NAME "OpenOrienteering-${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
set(CPACK_STRIP_FILES "TRUE")
# Focus on MinGW
set(CPACK_PACKAGE_EXECUTABLES CupCalculator "${CPACK_PACKAGE_NAME} ${PROJECT_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME} ${PROJECT_VERSION}")
set(CPACK_GENERATOR "ZIP" CACHE STRING "The binary package generators")
include(CPack)
# Installation
include(GNUInstallDirs)
install(FILES "COPYING"
RENAME COPYING.txt
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
)
install(FILES "README.md"
RENAME README.txt
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
)
if(MAKE_BUNDLE)
install(FILES "copyright"
RENAME openorienteering-cupcalculator-${PROJECT_VERSION}.txt
DESTINATION "${CMAKE_INSTALL_DOCDIR}/licensing"
)
endif()
if(WIN32)
include("unix2dos")
unix2dos_installed(
"${CMAKE_INSTALL_DOCDIR}/*"
"${CMAKE_INSTALL_DOCDIR}/licensing/*"
)
endif()
# Actual build
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra")
endif()
add_subdirectory(data)
add_subdirectory(src)
add_subdirectory(translations)
# Testing
include(CTest)
enable_testing()
add_test(NAME CupCalculatorTest COMMAND CupCalculatorTest)
# Auxiliary targets
set(ci
ci/azure-pipelines.yml
ci/build.yml
ci/filter-stderr.sed
ci/publish.yml
ci/publish-coverage.yml
ci/release-notes.yml
ci/setup-common.yml
ci/setup-msys2.yml
ci/setup-ubuntu.yml
ci/shell.sh
ci/openorienteering-cupcalculator-ci.cmake
)
add_custom_target(CI SOURCES ${ci})