Tue, 11 Apr 2023 20:27:04 +0300
Simplify signature of updateRenderPreferences
281
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
1 | cmake_minimum_required(VERSION 3.0) |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
2 | project(LDForge VERSION 1.0) |
272
9d52b119b3f5
Sort out versions more, add about page
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
269
diff
changeset
|
3 | set(COPYRIGHT "Copyright (C) 2013 - 2022 Teemu Piippo") |
269
593545977c5e
Further use APPNAME macro
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
268
diff
changeset
|
4 | string(TOLOWER ${PROJECT_NAME} TARGET_NAME) |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
5 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") |
302
d59cb01d8031
Enable cotire again
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
301
diff
changeset
|
6 | include(cotire) |
21 | 7 | set(OpenGL_GL_PREFERENCE GLVND) |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
8 | find_package(Qt6 COMPONENTS Core Widgets OpenGL UiPlugin OpenGLWidgets) |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
9 | if (Qt6_FOUND) |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
10 | message(NOTICE "-- Using Qt6") |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
11 | find_package(Qt6 REQUIRED COMPONENTS Core5Compat) |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
12 | # Unfortunately "Qt::UiPlugin" doesn't seem to work so let's resolve |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
13 | # it here instead... |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
14 | add_library(QtUiPlugin ALIAS Qt6::UiPlugin) |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
15 | else() |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
16 | message(NOTICE "-- Qt6 not found, using Qt5 instead") |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
17 | find_package(Qt5 5.5 REQUIRED COMPONENTS Core Widgets OpenGL UiPlugin) |
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
18 | add_library(QtUiPlugin ALIAS Qt5::UiPlugin) |
6 | 19 | endif() |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
20 | find_package(OpenGL REQUIRED) |
291
42b4953dff85
Let's bring GLEW back after all
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
281
diff
changeset
|
21 | find_package(GLEW REQUIRED) |
28 | 22 | find_package(GLM REQUIRED) |
23 | set(CMAKE_AUTOMOC ON) | |
24 | set(CMAKE_AUTOUIC ON) | |
25 | set(CMAKE_AUTORCC ON) | |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
26 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
28 | 27 | include_directories(${GLM_INCLUDE_DIR}) |
112 | 28 | add_definitions(-DQT_NO_KEYWORDS) |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
29 | source_group(${PROJECT_NAME} REGULAR_EXPRESSION "src/.+\\.(cpp|h|ui)") |
279
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
30 | |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
31 | if (NOT MSVC) |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
32 | if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
34 | endif() |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
35 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wunused") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
36 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
37 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
38 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-nonliteral -Wnonnull -Wnull-dereference -Winfinite-recursion -Wuninitialized -Wmissing-noreturn") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
39 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
40 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wundef -Wmissing-field-initializers") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
41 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wcast-align -Wcast-function-type -Wconversion") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
42 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-declarations -Wdate-time") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
43 | endif() |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
44 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
45 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcovered-switch-default -Wextra-semi -Wgnu -Wmicrosoft") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
46 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsometimes-uninitialized -Wstring-concatenation -Wstring-conversion -Wsuggest-override") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
47 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override -Wundefined-func-template -Wundefined-reinterpret-cast") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
48 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized-const-reference -Wunreachable-code -Wunreachable-code-break -Wunreachable-code-return") |
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
49 | endif() |
281
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
50 | |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
51 | # Pass some CMake variables down to the source code |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
52 | add_definitions(-DCMAKE_PROJECT_NAME="${CMAKE_PROJECT_NAME}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
53 | add_definitions(-DTARGET_NAME="${TARGET_NAME}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
54 | add_definitions(-DCMAKE_PROJECT_VERSION="${CMAKE_PROJECT_VERSION}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
55 | add_definitions(-DCOPYRIGHT="${COPYRIGHT}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
56 | add_definitions(-DCMAKE_CXX_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
57 | add_definitions(-DCMAKE_CXX_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
58 | add_definitions(-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
59 | add_definitions(-DCMAKE_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
60 | add_definitions(-DCMAKE_SYSTEM="${CMAKE_SYSTEM}") |
afed72b544f0
- Add CMake build type to about page and window title
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
279
diff
changeset
|
61 | add_definitions(-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}") |
279
cd70c845563a
Add build system information to the about dialog
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
272
diff
changeset
|
62 | |
253
8b994c917f69
Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
252
diff
changeset
|
63 | add_subdirectory(widgets) |
252
da4876bfd822
Move some widgets into a static library
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
250
diff
changeset
|
64 | |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
65 | set(SOURCE_FILES |
373
e34d6a30b96d
Move bezier curve to its own file
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
363
diff
changeset
|
66 | src/bezier_curve.cpp |
26 | 67 | src/colors.cpp |
3 | 68 | src/documentmanager.cpp |
55 | 69 | src/geometry.cpp |
152 | 70 | src/ldrawalgorithm.cpp |
331
638a7458ef5e
Add basic syntax highlighting
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
330
diff
changeset
|
71 | src/ldrawsyntaxhighlighter.cpp |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
72 | src/libraries.cpp |
322
a39f454a3d7f
Reduce edittools.cpp further
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
319
diff
changeset
|
73 | src/inputvertices.cpp |
17 | 74 | src/invert.cpp |
0 | 75 | src/main.cpp |
354
91053052bb28
Readd the MainWindow class and renderstyle button handling to it
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
331
diff
changeset
|
76 | src/mainwindow.cpp |
235
7ef03c2b46ab
Add a basic message log
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
233
diff
changeset
|
77 | src/messagelog.cpp |
3 | 78 | src/model.cpp |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
79 | src/parser.cpp |
150
b6cbba6e29a1
extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
148
diff
changeset
|
80 | src/polygoncache.cpp |
319
9727e545b0bc
Extract the triangulation and triangle merging code into a new source file and clean it up somewhat
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
317
diff
changeset
|
81 | src/triangulate.cpp |
16 | 82 | src/uiutilities.cpp |
1 | 83 | src/version.cpp |
117 | 84 | src/vertexmap.cpp |
70 | 85 | src/gl/basicshaderprogram.cpp |
17 | 86 | src/gl/compiler.cpp |
87 | src/gl/partrenderer.cpp | |
263
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
88 | src/layers/axeslayer.cpp |
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
89 | src/layers/edittools.cpp |
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
90 | src/layers/gridlayer.cpp |
16 | 91 | src/settingseditor/keyboardshortcutseditor.cpp |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
92 | src/settingseditor/librarieseditor.cpp |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
93 | src/settingseditor/settingseditor.cpp |
17 | 94 | src/types/boundingbox.cpp |
233 | 95 | src/ui/circletooloptionswidget.cpp |
178 | 96 | src/widgets/colorindexinput.cpp |
94
164f53fb5921
added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents:
92
diff
changeset
|
97 | src/widgets/colorselectdialog.cpp |
0 | 98 | ) |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
99 | set(HEADER_FILES |
3 | 100 | src/basics.h |
373
e34d6a30b96d
Move bezier curve to its own file
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
363
diff
changeset
|
101 | src/bezier_curve.h |
232
8efa3a33172e
Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
223
diff
changeset
|
102 | src/circularprimitive.h |
3 | 103 | src/colors.h |
104 | src/documentmanager.h | |
55 | 105 | src/geometry.h |
322
a39f454a3d7f
Reduce edittools.cpp further
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
319
diff
changeset
|
106 | src/inputvertices.h |
17 | 107 | src/invert.h |
152 | 108 | src/ldrawalgorithm.h |
331
638a7458ef5e
Add basic syntax highlighting
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
330
diff
changeset
|
109 | src/ldrawsyntaxhighlighter.h |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
110 | src/libraries.h |
354
91053052bb28
Readd the MainWindow class and renderstyle button handling to it
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
331
diff
changeset
|
111 | src/mainwindow.h |
235
7ef03c2b46ab
Add a basic message log
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
233
diff
changeset
|
112 | src/messagelog.h |
3 | 113 | src/model.h |
355
e81f4ad53efd
Move the about dialog to MainWindow. The hack to retrieve GL extensions is made a bit cleaner
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
354
diff
changeset
|
114 | src/modelsubwindow.h |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
115 | src/parser.h |
150
b6cbba6e29a1
extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
148
diff
changeset
|
116 | src/polygoncache.h |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
216
diff
changeset
|
117 | src/settings.h |
319
9727e545b0bc
Extract the triangulation and triangle merging code into a new source file and clean it up somewhat
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
317
diff
changeset
|
118 | src/triangulate.h |
218
63125c36de73
Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
216
diff
changeset
|
119 | src/typeconversions.h |
16 | 120 | src/uiutilities.h |
1 | 121 | src/version.h |
117 | 122 | src/vertexmap.h |
70 | 123 | src/gl/basicshaderprogram.h |
17 | 124 | src/gl/common.h |
125 | src/gl/compiler.h | |
126 | src/gl/partrenderer.h | |
263
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
127 | src/layers/axeslayer.h |
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
128 | src/layers/edittools.h |
59b6027b9843
Move render layer files to new src/layers/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
259
diff
changeset
|
129 | src/layers/gridlayer.h |
16 | 130 | src/settingseditor/keyboardshortcutseditor.h |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
131 | src/settingseditor/librarieseditor.h |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
132 | src/settingseditor/settingseditor.h |
17 | 133 | src/types/boundingbox.h |
233 | 134 | src/ui/circletooloptionswidget.h |
178 | 135 | src/widgets/colorindexinput.h |
94
164f53fb5921
added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents:
92
diff
changeset
|
136 | src/widgets/colorselectdialog.h |
301
8ccd6fdb30dc
Move earcut.h outside src/ directory
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
299
diff
changeset
|
137 | thirdparty/earcut.h |
0 | 138 | ) |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
139 | set(FORM_FILES |
272
9d52b119b3f5
Sort out versions more, add about page
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
269
diff
changeset
|
140 | src/about.ui |
1 | 141 | src/mainwindow.ui |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
142 | src/settingseditor/librarieseditor.ui |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
143 | src/settingseditor/settingseditor.ui |
232
8efa3a33172e
Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
223
diff
changeset
|
144 | src/ui/circletool.ui |
94
164f53fb5921
added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents:
92
diff
changeset
|
145 | src/widgets/colorselectdialog.ui |
178 | 146 | src/widgets/colorindexinput.ui |
0 | 147 | ) |
6 | 148 | |
232
8efa3a33172e
Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
223
diff
changeset
|
149 | set(CMAKE_AUTOUIC_SEARCH_PATHS src/ui) |
267
9a482f506747
rename ldforge.qrc -> resources.qrc
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
266
diff
changeset
|
150 | set(QRC_FILE resources.qrc) |
148 | 151 | set(CMAKE_CXX_STANDARD 20) |
39
caac957e9834
Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents:
33
diff
changeset
|
152 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
caac957e9834
Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents:
33
diff
changeset
|
153 | set(CMAKE_CXX_EXTENSIONS OFF) |
caac957e9834
Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents:
33
diff
changeset
|
154 | include_directories("${PROJECT_BINARY_DIR}") |
caac957e9834
Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents:
33
diff
changeset
|
155 | include_directories("${PROJECT_BINARY_DIR}/src") |
252
da4876bfd822
Move some widgets into a static library
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
250
diff
changeset
|
156 | include_directories("${PROJECT_SOURCE_DIR}") |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
157 | qt_add_resources(QRC_SOURCE ${QRC_FILE}) |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
158 | qt_wrap_ui(FORMS_HEADERS ${FORM_FILES}) |
6 | 159 | |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
160 | add_executable(${TARGET_NAME} WIN32 |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
161 | ${SOURCE_FILES} |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
162 | ${HEADER_FILES} |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
163 | ${QRC_FILE} |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
164 | ${QRC_SOURCE} |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
165 | ${FORMS_HEADERS} |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
166 | ${OTHER_FILES} |
0 | 167 | ) |
6 | 168 | |
266
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
169 | set_source_files_properties(${HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
170 | set_source_files_properties(${QRC_FILE} PROPERTIES HEADER_FILE_ONLY TRUE) |
2800a15e2a2f
use project name more in cmakelists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
264
diff
changeset
|
171 | set_source_files_properties(${OTHER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
172 | set_target_properties(${TARGET_NAME} PROPERTIES AUTOMOC 1) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
173 | target_link_libraries(${TARGET_NAME} PRIVATE Qt::Core) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
174 | target_link_libraries(${TARGET_NAME} PRIVATE Qt::Widgets) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
175 | target_link_libraries(${TARGET_NAME} PRIVATE Qt::OpenGL) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
176 | target_link_libraries(${TARGET_NAME} PRIVATE ${OPENGL_LIBRARIES}) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
177 | target_link_libraries(${TARGET_NAME} PRIVATE ${GLEW_LIBRARIES}) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
178 | target_link_libraries(${TARGET_NAME} PRIVATE ${WIDGETLIB}) |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
179 | if (Qt6_FOUND) |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
180 | target_link_libraries(${TARGET_NAME} PRIVATE Qt6::Core5Compat) |
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
181 | target_link_libraries(${TARGET_NAME} PRIVATE Qt6::OpenGLWidgets) |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
256
diff
changeset
|
182 | endif() |
302
d59cb01d8031
Enable cotire again
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
301
diff
changeset
|
183 | cotire(${TARGET_NAME}) |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
184 | |
114
4e03b0e2a29f
added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
185 | add_custom_target(linelength ALL |
4e03b0e2a29f
added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
186 | COMMAND python3 |
4e03b0e2a29f
added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
187 | "${CMAKE_SOURCE_DIR}/tools/linelength.py" |
267
9a482f506747
rename ldforge.qrc -> resources.qrc
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
266
diff
changeset
|
188 | ${SOURCE_FILES} |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
189 | ${HEADER_FILESl} |
114
4e03b0e2a29f
added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
190 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
191 | add_dependencies(${TARGET_NAME} linelength) |
114
4e03b0e2a29f
added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents:
112
diff
changeset
|
192 | |
317
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
193 | add_custom_target(indentlevel ALL |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
194 | COMMAND python3 |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
195 | "${CMAKE_SOURCE_DIR}/tools/indentlevel.py" |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
196 | ${SOURCE_FILES} |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
197 | ${HEADER_FILESl} |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
198 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
199 | add_dependencies(${TARGET_NAME} indentlevel) |
852021f38b66
Let's try to keep the amount of indents in check...
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
302
diff
changeset
|
200 | |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
201 | # Collect the current hg revision into hginfo.h |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
202 | add_custom_target(revision_check ALL |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
203 | COMMAND python3 "${CMAKE_SOURCE_DIR}/tools/updaterevision.py" --cwd "$(CMAKE_SOURCE_DIR)" hginfo.h |
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
204 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
205 | add_dependencies(${TARGET_NAME} revision_check) |
7
68443f5be176
added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
206 | |
268
fb319526ba6c
Define application name and version in CMakeLists
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
267
diff
changeset
|
207 | install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin) |