CMakeLists.txt

Sun, 26 Jun 2022 20:54:09 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sun, 26 Jun 2022 20:54:09 +0300
changeset 262
dc33f8a707c4
parent 259
c27612f0eac0
child 263
59b6027b9843
permissions
-rw-r--r--

Add action to make a model unofficial (modifies the !LDRAW_ORG line)

0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 project(ldforge)
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 cmake_minimum_required(VERSION 2.8.12)
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
3 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
21
Teemu Piippo <teemu@hecknology.net>
parents: 20
diff changeset
4 set(OpenGL_GL_PREFERENCE GLVND)
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
5 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
6 if (Qt6_FOUND)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
7 message(NOTICE "-- Using Qt6")
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
8 find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
9 # 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
10 # it here instead...
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
11 add_library(QtUiPlugin ALIAS Qt6::UiPlugin)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
12 else()
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
13 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
14 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
15 add_library(QtUiPlugin ALIAS Qt5::UiPlugin)
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
16 endif()
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
17 find_package(OpenGL REQUIRED)
28
c92c1daf735f modelview matrix set up
Teemu Piippo <teemu@hecknology.net>
parents: 26
diff changeset
18 find_package(GLM REQUIRED)
c92c1daf735f modelview matrix set up
Teemu Piippo <teemu@hecknology.net>
parents: 26
diff changeset
19 set(CMAKE_AUTOMOC ON)
c92c1daf735f modelview matrix set up
Teemu Piippo <teemu@hecknology.net>
parents: 26
diff changeset
20 set(CMAKE_AUTOUIC ON)
c92c1daf735f modelview matrix set up
Teemu Piippo <teemu@hecknology.net>
parents: 26
diff changeset
21 set(CMAKE_AUTORCC ON)
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
22 include_directories(${CMAKE_CURRENT_BINARY_DIR})
28
c92c1daf735f modelview matrix set up
Teemu Piippo <teemu@hecknology.net>
parents: 26
diff changeset
23 include_directories(${GLM_INCLUDE_DIR})
112
5760cbb32bc0 use QT_NO_KEYWORDS
Teemu Piippo <teemu@hecknology.net>
parents: 105
diff changeset
24 add_definitions(-DQT_NO_KEYWORDS)
191
d355d4c52d51 made editing tools not a polymorphic class tree
Teemu Piippo <teemu@hecknology.net>
parents: 186
diff changeset
25 source_group("LDForge" REGULAR_EXPRESSION "src/.+\\.(cpp|h|ui)")
253
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 252
diff changeset
26 add_subdirectory(widgets)
252
da4876bfd822 Move some widgets into a static library
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 250
diff changeset
27
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 set (LDFORGE_SOURCES
26
3a9e761e4faa at least VAOs work now
Teemu Piippo <teemu@hecknology.net>
parents: 21
diff changeset
29 src/colors.cpp
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 7
diff changeset
30 src/document.cpp
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
31 src/documentmanager.cpp
55
cb81ecb5fb23 grid stuff
Teemu Piippo <teemu@hecknology.net>
parents: 53
diff changeset
32 src/geometry.cpp
152
03f8e6d42e13 Major refactoring
Teemu Piippo <teemu@hecknology.net>
parents: 150
diff changeset
33 src/ldrawalgorithm.cpp
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
34 src/libraries.cpp
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
35 src/invert.cpp
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 src/main.cpp
235
7ef03c2b46ab Add a basic message log
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 233
diff changeset
37 src/messagelog.cpp
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
38 src/model.cpp
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
39 src/parser.cpp
150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents: 148
diff changeset
40 src/polygoncache.cpp
16
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
41 src/uiutilities.cpp
1
51d14b0c68c0 add version
Teemu Piippo <teemu@hecknology.net>
parents: 0
diff changeset
42 src/version.cpp
117
121a40d5e34c Add vertex map
Teemu Piippo <teemu@hecknology.net>
parents: 114
diff changeset
43 src/vertexmap.cpp
69
a36913fc552a begin work on axes program
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
44 src/gl/axesprogram.cpp
70
f21b800b02a4 Added axes rendering
Teemu Piippo <teemu@hecknology.net>
parents: 69
diff changeset
45 src/gl/basicshaderprogram.cpp
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
46 src/gl/compiler.cpp
237
10a6298f636f Add an option to log opengl messages
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 235
diff changeset
47 src/gl/debug.cpp
216
c7241f504117 Reworked grid program into a render layer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 215
diff changeset
48 src/gl/gridprogram.cpp
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
49 src/gl/partrenderer.cpp
215
34c6e7bc4ee1 Reimplement the axes program as a layer that can be added to PartRenderer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 214
diff changeset
50 # src/gl/vertexprogram.cpp
16
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
51 src/settingseditor/keyboardshortcutseditor.cpp
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
52 src/settingseditor/librarieseditor.cpp
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
53 src/settingseditor/settingseditor.cpp
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
54 src/types/boundingbox.cpp
233
5509bec02c81 fix various things
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 232
diff changeset
55 src/ui/circletooloptionswidget.cpp
81
62373840e33a object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents: 70
diff changeset
56 src/ui/objecteditor.cpp
178
a23024fc98e0 fix saving
Teemu Piippo <teemu@hecknology.net>
parents: 176
diff changeset
57 src/widgets/colorindexinput.cpp
94
164f53fb5921 added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents: 92
diff changeset
58 src/widgets/colorselectdialog.cpp
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
59 )
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
60 set (LDFORGE_HEADERS
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
61 src/basics.h
232
8efa3a33172e Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 223
diff changeset
62 src/circularprimitive.h
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
63 src/colors.h
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 7
diff changeset
64 src/document.h
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
65 src/documentmanager.h
63
f7dd937667a5 omg functional programming
Teemu Piippo <teemu@hecknology.net>
parents: 55
diff changeset
66 src/functional.h
55
cb81ecb5fb23 grid stuff
Teemu Piippo <teemu@hecknology.net>
parents: 53
diff changeset
67 src/geometry.h
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
68 src/invert.h
152
03f8e6d42e13 Major refactoring
Teemu Piippo <teemu@hecknology.net>
parents: 150
diff changeset
69 src/ldrawalgorithm.h
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
70 src/libraries.h
235
7ef03c2b46ab Add a basic message log
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 233
diff changeset
71 src/messagelog.h
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents: 2
diff changeset
72 src/model.h
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
73 src/parser.h
150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents: 148
diff changeset
74 src/polygoncache.h
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
75 src/ring.h
218
63125c36de73 Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 216
diff changeset
76 src/settings.h
63125c36de73 Replace config collector with a simpler system
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 216
diff changeset
77 src/typeconversions.h
16
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
78 src/uiutilities.h
1
51d14b0c68c0 add version
Teemu Piippo <teemu@hecknology.net>
parents: 0
diff changeset
79 src/version.h
117
121a40d5e34c Add vertex map
Teemu Piippo <teemu@hecknology.net>
parents: 114
diff changeset
80 src/vertexmap.h
223
ce81db996275 Use Mapbox's ear clipping algorithm to handle drawing any simple polygon
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 221
diff changeset
81 src/algorithm/earcut.h
69
a36913fc552a begin work on axes program
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
82 src/gl/axesprogram.h
70
f21b800b02a4 Added axes rendering
Teemu Piippo <teemu@hecknology.net>
parents: 69
diff changeset
83 src/gl/basicshaderprogram.h
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
84 src/gl/common.h
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
85 src/gl/compiler.h
237
10a6298f636f Add an option to log opengl messages
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 235
diff changeset
86 src/gl/debug.h
216
c7241f504117 Reworked grid program into a render layer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 215
diff changeset
87 src/gl/gridprogram.h
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
88 src/gl/partrenderer.h
215
34c6e7bc4ee1 Reimplement the axes program as a layer that can be added to PartRenderer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 214
diff changeset
89 # src/gl/vertexprogram.h
16
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
90 src/settingseditor/keyboardshortcutseditor.h
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
91 src/settingseditor/librarieseditor.h
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
92 src/settingseditor/settingseditor.h
17
a5111f4e6412 added teapot rendering
Teemu Piippo <teemu@hecknology.net>
parents: 16
diff changeset
93 src/types/boundingbox.h
233
5509bec02c81 fix various things
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 232
diff changeset
94 src/ui/circletooloptionswidget.h
81
62373840e33a object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents: 70
diff changeset
95 src/ui/objecteditor.h
178
a23024fc98e0 fix saving
Teemu Piippo <teemu@hecknology.net>
parents: 176
diff changeset
96 src/widgets/colorindexinput.h
94
164f53fb5921 added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents: 92
diff changeset
97 src/widgets/colorselectdialog.h
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
98 )
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
99 set (LDFORGE_FORMS
1
51d14b0c68c0 add version
Teemu Piippo <teemu@hecknology.net>
parents: 0
diff changeset
100 src/mainwindow.ui
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
101 src/settingseditor/librarieseditor.ui
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
102 src/settingseditor/settingseditor.ui
232
8efa3a33172e Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 223
diff changeset
103 src/ui/circletool.ui
182
27fb1c3c9fbb add ui file to object editor
Teemu Piippo <teemu@hecknology.net>
parents: 180
diff changeset
104 src/ui/objecteditor.ui
94
164f53fb5921 added a color select dialog
Teemu Piippo <teemu@hecknology.net>
parents: 92
diff changeset
105 src/widgets/colorselectdialog.ui
178
a23024fc98e0 fix saving
Teemu Piippo <teemu@hecknology.net>
parents: 176
diff changeset
106 src/widgets/colorindexinput.ui
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
107 )
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
108
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
109 set(LDFORGE_LOCALES
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
110 locale/fi.ts
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
111 locale/sv.ts
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
112 )
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
113
42
1d03dc1173cd made configurationoptions.txt visible in Qt Creator
Teemu Piippo <teemu@hecknology.net>
parents: 41
diff changeset
114 set (LDFORGE_OTHER_FILES
1d03dc1173cd made configurationoptions.txt visible in Qt Creator
Teemu Piippo <teemu@hecknology.net>
parents: 41
diff changeset
115 )
1d03dc1173cd made configurationoptions.txt visible in Qt Creator
Teemu Piippo <teemu@hecknology.net>
parents: 41
diff changeset
116
232
8efa3a33172e Add base code for circular primitives
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 223
diff changeset
117 set(CMAKE_AUTOUIC_SEARCH_PATHS src/ui)
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
118 set(LDFORGE_RESOURCES ldforge.qrc)
148
e1ced2523cad reworking
Teemu Piippo <teemu@hecknology.net>
parents: 140
diff changeset
119 set(CMAKE_CXX_STANDARD 20)
39
caac957e9834 Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents: 33
diff changeset
120 set(CMAKE_CXX_STANDARD_REQUIRED ON)
caac957e9834 Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents: 33
diff changeset
121 set(CMAKE_CXX_EXTENSIONS OFF)
caac957e9834 Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents: 33
diff changeset
122 include_directories("${PROJECT_BINARY_DIR}")
caac957e9834 Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents: 33
diff changeset
123 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
124 include_directories("${PROJECT_SOURCE_DIR}")
39
caac957e9834 Main color is now configurable
Teemu Piippo <teemu@hecknology.net>
parents: 33
diff changeset
125 include_directories("${PROJECT_SOURCE_DIR}/src")
10
e249d97c7fe6 fixed translations being updated twice at the same time, that's bad
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
126 add_custom_target(resources ALL DEPENDS ${LDFORGE_RESOURCES})
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
127
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
128 if (NOT MSVC)
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
129 if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
130 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
131 endif()
250
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
132 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wunused")
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
133 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough")
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
134 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type")
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
135 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-nonliteral -Wnonnull -Wnull-dereference -Winfinite-recursion -Wuninitialized -Wmissing-noreturn")
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
136 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
137 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wundef -Wmissing-field-initializers")
250
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
138 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual -Wcast-align -Wcast-function-type -Wconversion")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
139 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-declarations -Wdate-time")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
140 endif()
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
141 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
142 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcovered-switch-default -Wextra-semi -Wgnu -Wmicrosoft")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
143 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wsometimes-uninitialized -Wstring-concatenation -Wstring-conversion -Wsuggest-override")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
144 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override -Wundefined-func-template -Wundefined-reinterpret-cast")
2837b549e616 I felt that the compiler was too kind to me, so I enabled a big pile of warnings
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 237
diff changeset
145 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized-const-reference -Wunreachable-code -Wunreachable-code-break -Wunreachable-code-return")
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
146 endif()
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
147 qt_add_resources(LDFORGE_QRC ${LDFORGE_RESOURCES})
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
148 qt_wrap_ui(LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS})
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
149
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
150 add_executable(ldforge WIN32
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
151 ${LDFORGE_SOURCES}
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
152 ${LDFORGE_HEADERS}
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
153 ${LDFORGE_RESOURCES}
158
5bd755eaa5a8 Add icons from ionicons
Teemu Piippo <teemu@hecknology.net>
parents: 153
diff changeset
154 ${LDFORGE_QRC}
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
155 ${LDFORGE_FORMS_HEADERS}
42
1d03dc1173cd made configurationoptions.txt visible in Qt Creator
Teemu Piippo <teemu@hecknology.net>
parents: 41
diff changeset
156 ${LDFORGE_OTHER_FILES}
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
157 )
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
158
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
159 set_source_files_properties(${LDFORGE_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE)
6
73e448b2943d language support
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
160 set_source_files_properties(${LDFORGE_RESOURCES} PROPERTIES HEADER_FILE_ONLY TRUE)
42
1d03dc1173cd made configurationoptions.txt visible in Qt Creator
Teemu Piippo <teemu@hecknology.net>
parents: 41
diff changeset
161 set_source_files_properties(${LDFORGE_OTHER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
0
f9f4d4d6f162 initial commit
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
162 set_target_properties(ldforge PROPERTIES AUTOMOC 1)
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
163 target_link_libraries(ldforge PRIVATE Qt::Core)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
164 target_link_libraries(ldforge PRIVATE Qt::Widgets)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
165 target_link_libraries(ldforge PRIVATE Qt::OpenGL)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
166 target_link_libraries(ldforge PRIVATE ${OPENGL_LIBRARIES})
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
167 target_link_libraries(ldforge PRIVATE ${GLEW_LIBRARIES})
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
168 target_link_libraries(ldforge PRIVATE ldforgewidgets)
100
43ce3672648a fix build
Teemu Piippo <teemu@hecknology.net>
parents: 99
diff changeset
169 add_dependencies(ldforge resources)
259
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
170 if (Qt6_FOUND)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
171 target_link_libraries(ldforge PRIVATE Qt6::Core5Compat)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
172 target_link_libraries(ldforge PRIVATE Qt6::OpenGLWidgets)
c27612f0eac0 - Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 256
diff changeset
173 endif()
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
174
114
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
175 add_custom_target(linelength ALL
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
176 COMMAND python3
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
177 "${CMAKE_SOURCE_DIR}/tools/linelength.py"
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
178 ${LDFORGE_SOURCES}
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
179 ${LDFORGE_HEADERS}
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
180 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
181 add_dependencies(ldforge linelength)
4e03b0e2a29f added build-time test for line length
Teemu Piippo <teemu@hecknology.net>
parents: 112
diff changeset
182
7
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
183 # Collect the current hg revision into hginfo.h
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
184 add_custom_target(revision_check ALL
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
185 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
186 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
187 add_dependencies(ldforge revision_check)
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
188
68443f5be176 added the settings editor
Teemu Piippo <teemu@hecknology.net>
parents: 6
diff changeset
189 install(TARGETS ldforge RUNTIME DESTINATION bin)

mercurial