-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (70 loc) · 2.45 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
#
# SimpleTimer is a tool to display and notify regularly
# Copyright (C) 2017-2019 Cedric OCHS
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
# Allows qtmain to be linked auto
IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()
# Let automoc also process generated files
IF(POLICY CMP0071)
CMAKE_POLICY(SET CMP0071 NEW)
ENDIF()
# Use AppleClang for OS X compiler
IF(POLICY CMP0025)
CMAKE_POLICY(SET CMP0025 NEW)
ENDIF()
INCLUDE(UseCMakeModules.cmake)
SET(VERSION_MAJOR 1)
SET(VERSION_MINOR 9)
SET(VERSION_PATCH "REVISION")
SET(AUTHOR "Kervala")
SET(PRODUCT "kTimer")
SET(DESCRIPTION "kTimer by Kervala")
SET(TARGET "ktimer")
SET(YEAR "2021-${CURRENT_YEAR}")
PROJECT(${PRODUCT} C CXX)
# Instruct CMake to run moc automatically when needed.
SET(CMAKE_AUTOMOC ON)
INIT_DEFAULT_OPTIONS()
# Qt doesn't use RTTI or C++ exceptions
SET_OPTION_DEFAULT(WITH_EXCEPTIONS OFF)
SET_OPTION_DEFAULT(WITH_RTTI OFF)
SET_OPTION_DEFAULT(WITH_INSTALL_LIBRARIES OFF)
SETUP_DEFAULT_OPTIONS()
INIT_BUILD_FLAGS()
SETUP_BUILD_FLAGS()
SETUP_PREFIX_PATHS(${TARGET})
SETUP_EXTERNAL()
GEN_CONFIG_H()
GEN_REVISION_H()
USE_QT_MODULES(Gui Network Svg Widgets) # WinExtras
# To fix compilation of MOC files under Linux
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
FILE(GLOB HEADER src/*.h)
FILE(GLOB SRC src/*.cpp)
FILE(GLOB UI ui/*.ui)
FILE(GLOB RES res/*.qrc res/*.icns res/*.ico)
FILE(GLOB TS translations/*.ts)
SET_TARGET_GUI_EXECUTABLE(${TARGET} ${SRC} ${RES} ${UI} ${HEADER} ${TS} NAME ${PRODUCT} LABEL ${PRODUCT})
IF(APPLE)
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "net.kervala.${TARGET}")
ENDIF()
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(${TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/src/common.h ${CMAKE_CURRENT_SOURCE_DIR}/src/common.cpp)
ENDIF()
INSTALL_RESOURCES(${TARGET} "")