-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
97 lines (75 loc) · 1.88 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
cmake_minimum_required(VERSION 3.14)
project(CheatSh)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)
find_package(QtCreator COMPONENTS Core REQUIRED)
find_package(QT NAMES Qt6 COMPONENTS Widgets REQUIRED)
find_package(Git)
set(QtX Qt${QT_VERSION_MAJOR})
# 3rdparites
include_directories(ANSIEsc2HTML/src)
add_subdirectory(ANSIEsc2HTML)
# Translations
find_package(Qt6LinguistTools)
set(TS_FILES
i18n/cheatsh_ru.ts
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/i18n)
configure_file(i18n/i18n.qrc ${CMAKE_CURRENT_BINARY_DIR}/i18n COPYONLY)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "i18n")
if(COMMAND qt_create_translation)
qt_add_translation(QM_FILES ${TS_FILES})
else()
qt5_add_translation(QM_FILES ${TS_FILES})
endif()
# Versioning
exec_program(
"git"
${CMAKE_CURRENT_SOURCE_DIR}/.git
ARGS "--work-tree" "${CMAKE_CURRENT_SOURCE_DIR}" "describe" "--always" "--tags" "--abbrev=0"
OUTPUT_VARIABLE GIT_VERSION )
add_definitions( -DGIT_VERSION="${GIT_VERSION}")
# SOURCES
add_qtc_plugin(CheatSh
PLUGIN_DEPENDS
QtCreator::Core
QtCreator::TextEditor
DEPENDS
${QtX}::Widgets
QtCreator::ExtensionSystem
QtCreator::Utils
ANSIEsc2HTML_static
SOURCES
.github/workflows/build_cmake.yml
.github/workflows/README.md
resources.qrc
${TS_FILES}
${QM_FILES}
${CMAKE_CURRENT_BINARY_DIR}/i18n/i18n.qrc
README.md
cheatshplugin.cpp
cheatshplugin.h
cheatfilter.cpp
cheatfilter.h
cheatoutputplane.cpp
cheatoutputplane.h
optionsdialog.ui
optionsdialog.cpp
optionsdialog.h
optionspage.cpp
optionspage.h
progressreport.cpp
progressreport.h
querymanager.cpp
querymanager.h
settings.cpp
settings.h
updatechecker.cpp
updatechecker.h
cheatsh_global.h
cheatshconstants.h
VERSION
${GIT_VERSION}
)