-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
153 lines (136 loc) · 5.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
cmake_minimum_required(VERSION 3.5)
project(qt-editor LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check https://doc.qt.io/qt/deployment-android.html for more information.
# They need to be set before the find_package( ...) calls below.
#if(ANDROID)
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
# set(ANDROID_EXTRA_LIBS
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
# endif()
#endif()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets Multimedia LinguistTools REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Multimedia LinguistTools REQUIRED)
set(TS_FILES qt-editor_en_GB.ts qt-editor_German.ts)
add_subdirectory(3rdParty/libmodplug)
add_subdirectory(3rdParty/alive_reversing/Source/Tools/relive_api)
include_directories(3rdParty/libmodplug/src)
include_directories(3rdParty/jsonxx)
include_directories(Source)
add_library(jsonxx 3rdParty/jsonxx/jsonxx.cc)
target_include_directories(jsonxx PUBLIC
$<BUILD_INTERFACE:
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/jsonxx)
export(TARGETS jsonxx FILE jsonxx.cmake)
set_property(TARGET jsonxx PROPERTY FOLDER "3rdParty")
set(PROJECT_SOURCES
Source/ReliveApiWrapper.hpp
Source/SnapSettings.hpp
Source/ClipBoard.cpp
Source/ClipBoard.hpp
Source/DeleteItemsCommand.cpp
Source/DeleteItemsCommand.hpp
Source/ProgressDialog.hpp
Source/ProgressDialog.cpp
Source/ProgressDialog.ui
Source/TransparencyDialog.hpp
Source/TransparencyDialog.cpp
Source/TransparencyDialog.ui
Source/SelectionSaver.hpp
Source/AddObjectDialog.hpp
Source/AddObjectDialog.cpp
Source/AddObjectDialog.ui
Source/ChangeMapSizeDialog.hpp
Source/ChangeMapSizeDialog.cpp
Source/ChangeMapSizeDialog.ui
Source/PathDataEditorDialog.hpp
Source/PathDataEditorDialog.cpp
Source/PathDataEditorDialog.ui
Source/MessageEditorDialog.cpp
Source/MessageEditorDialog.hpp
Source/MessageEditorDialog.ui
Source/CameraManager.cpp
Source/CameraManager.hpp
Source/CameraManager.ui
Source/CollisionConnect.cpp
Source/CollisionConnect.hpp
Source/ExportPathDialog.hpp
Source/ExportPathDialog.cpp
Source/Exporter.hpp
Source/Exporter.cpp
Source/ExportPathDialog.ui
Source/PathSelectionDialog.hpp
Source/PathSelectionDialog.cpp
Source/PathSelectionDialog.ui
Source/IGraphicsItem.hpp
Source/main.cpp
Source/AboutDialog.ui
Source/EditorMainWindow.ui
Source/EditorTab.ui
Source/EditorMainWindow.cpp
Source/EditorMainWindow.hpp
Source/EditorTab.cpp
Source/EditorTab.hpp
Source/FireWidget.cpp
Source/FireWidget.hpp
Source/AboutDialog.cpp
Source/AboutDialog.hpp
Source/ModThread.cpp
Source/ModThread.hpp
Source/Model.cpp
Source/Model.hpp
Source/ResizeableArrowItem.cpp
Source/ResizeableArrowItem.hpp
Source/ResizeableRectItem.cpp
Source/ResizeableRectItem.hpp
Source/CameraGraphicsItem.cpp
Source/CameraGraphicsItem.hpp
Source/EditorGraphicsScene.cpp
Source/EditorGraphicsScene.hpp
Source/BigSpinBox.cpp
Source/BigSpinBox.hpp
Source/PropertyTreeItemBase.hpp
Source/StringProperty.hpp
Source/StringProperty.cpp
Source/PropertyTreeWidget.cpp
Source/PropertyTreeWidget.hpp
Source/BasicTypeProperty.hpp
Source/BasicTypeProperty.cpp
Source/BasicTypeProperty.hpp
Source/BasicTypeProperty.cpp
Source/EnumProperty.cpp
Source/EnumProperty.hpp
Source/resources.qrc
${TS_FILES}
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source ${TS_FILES})
qt_add_executable(qt-editor ${PROJECT_SOURCES} ${QM_FILES})
else()
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source ${TS_FILES})
if(ANDROID)
add_library(qt-editor SHARED ${PROJECT_SOURCES} ${QM_FILES})
elseif(WIN32)
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/Source/rsc/icons/qt-editor.rc")
add_executable(qt-editor ${PROJECT_SOURCES} ${QM_FILES} ${APP_ICON_RESOURCE_WINDOWS})
else()
add_executable(qt-editor ${PROJECT_SOURCES} ${QM_FILES})
endif()
endif()
if (MSVC)
target_compile_options(qt-editor PUBLIC "/permissive-")
endif()
target_link_libraries(qt-editor PUBLIC relive_api Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia modplug jsonxx)
set(CPACK_PACKAGE_NAME "qt-editor")
set(CPACK_PACKAGE_CONTACT "nemin@oddwords.hu")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://aliveteam.github.io/")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "qtdeclarative5-dev, qtmultimedia5-dev, qttools5-dev")
INCLUDE(CPack)