Skip to content

Commit 4a63c99

Browse files
committed
msvc build changes
1 parent 4a42435 commit 4a63c99

File tree

10 files changed

+79
-68
lines changed

10 files changed

+79
-68
lines changed

apps/apps.pri

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ DEPENDPATH += $$LIBGUI_ROOT \
2929

3030
unix:LIBS += $$QMAKE_LIBS_EXECINFO
3131
windows:RCC_DIR=src/
32-
windows:DESTDIR=$$PWD
3332

3433
isEqual(PRIVATE_PLUGINS, false) {
3534
windows:RC_FILE=res/windows_ico.qrc

apps/pgmodeler-se/pgmodeler-se.pro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ DEPENDPATH += ../pgmodeler \
3030
# Forcing the linker to use the objects files generated
3131
# during the compilation of the main executable since
3232
# pgmodeler-se uses the same application class
33-
OBJECTS += ../pgmodeler/obj/pgmodelerapp.o \
34-
../pgmodeler/obj/moc_pgmodelerapp.o
33+
windows: OBJECTS += ../pgmodeler/obj/pgmodelerapp.obj ../pgmodeler/obj/moc_pgmodelerapp.obj
34+
else: OBJECTS += ../pgmodeler/obj/pgmodelerapp.o ../pgmodeler/obj/moc_pgmodelerapp.o
3535

3636
# Deployment settings
3737
target.path = $$PRIVATEBINDIR
3838
INSTALLS = target
3939

40-
# Print the current build settins (see pgmodeler.pri)
40+
# Print the current build settings (see pgmodeler.pri)
4141
printBuildDetails()

libs/libcanvas/libcanvas.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = canvas
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += CANVAS_SYMBOLS

libs/libcli/libcli.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = cli
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += CLI_SYMBOLS

libs/libconnector/libconnector.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = connector
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += CONNECTOR_SYMBOLS

libs/libcore/libcore.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = core
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += CORE_SYMBOLS

libs/libgui/libgui.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ isEqual(PRIVATE_PLUGINS, false) {
1616
RESOURCES += res/resources.qrc
1717

1818
windows:RCC_DIR += src
19-
windows:DESTDIR = $$PWD
2019

2120
# Enables shared library symbols exporting
2221
DEFINES += GUI_SYMBOLS
@@ -382,7 +381,8 @@ INCLUDEPATH += $$LIBCANVAS_INC \
382381
$$PWD/src/settings \
383382
$$PWD/src/tools \
384383
$$PWD/src/utils \
385-
$$PWD/src/widgets
384+
$$PWD/src/widgets \
385+
$$PWD/src
386386

387387
DEPENDPATH += $$LIBCANVAS_ROOT \
388388
$$LIBCONNECTOR_ROOT \

libs/libparsers/libparsers.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = parsers
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += PARSERS_SYMBOLS

libs/libutils/libutils.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ include(../../pgmodeler.pri)
22

33
TEMPLATE = lib
44
TARGET = utils
5-
windows: DESTDIR = $$PWD
65

76
# Enables shared library symbols exporting
87
DEFINES += UTILS_SYMBOLS

pgmodeler.pri

Lines changed: 74 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -9,59 +9,77 @@ OBJECTS_DIR = obj
99
UI_DIR = src
1010

1111
contains(CONFIG, debug):{
12-
DEFINES+=PGMODELER_DEBUG
12+
DEFINES+=PGMODELER_DEBUG
1313

14-
# Enabling ccache (https://ccache.dev) in debug mode to speed up recompilations
15-
isEqual(USE_CCACHE, true):CONFIG+=ccache
14+
# Enabling ccache (https://ccache.dev) in debug mode to speed up recompilations
15+
isEqual(USE_CCACHE, true):CONFIG+=ccache
1616
}
1717

18+
msvc:DEFINES+=__PRETTY_FUNCTION__=__FUNCTION__
19+
1820
# Disables all the APIs deprecated before Qt 6.4.0
1921
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060400
2022
!defined(NO_CHECK_CURR_VER, var):DEFINES+=CHECK_CURR_VER
2123

2224
# Forcing the compilation using Qt 6.4.x
2325
!versionAtLeast(QT_VERSION, "6.4.0") {
24-
error("Unsupported Qt version detected: $${QT_VERSION}! pgModeler must be compiled with at least Qt 6.4.0")
26+
error("Unsupported Qt version detected: $${QT_VERSION}! pgModeler must be compiled with at least Qt 6.4.0")
2527
}
2628

2729
# Store the absolute paths to library subprojects to be referenced in other .pro files
2830
# *_ROOT -> the path to the root folder of the subproject
29-
# *_LIB -> the libary flags (-L -l) (LIBS on qmake) passed to the compiler that points to the library generated from a subproject
31+
# *_LIB -> the library flags (-L -l) (LIBS on qmake) passed to the compiler that points to the library generated from a subproject
3032
# *_INC -> the path to the source code folder (src), used by the flag -I (INCLUDEPATH on qmake) passed to the compiler
33+
3134
LIBCANVAS = libcanvas
3235
LIBCANVAS_ROOT = $$absolute_path($$PWD/libs/$$LIBCANVAS)
33-
LIBCANVAS_LIB = -L$$LIBCANVAS_ROOT -lcanvas
34-
LIBCANVAS_INC = $$LIBCANVAS_ROOT/src
36+
LIBCANVAS_INC = $$LIBCANVAS_ROOT/src $$top_builddir/libs/$$LIBCANVAS/src
3537

3638
LIBCONNECTOR = libconnector
3739
LIBCONNECTOR_ROOT = $$absolute_path($$PWD/libs/$$LIBCONNECTOR)
38-
LIBCONNECTOR_LIB = -L$$LIBCONNECTOR_ROOT -lconnector
39-
LIBCONNECTOR_INC = $$LIBCONNECTOR_ROOT/src
40+
LIBCONNECTOR_INC = $$LIBCONNECTOR_ROOT/src $$top_builddir/libs/$$LIBCONNECTOR/src
4041

4142
LIBCORE = libcore
4243
LIBCORE_ROOT = $$absolute_path($$PWD/libs/$$LIBCORE)
43-
LIBCORE_LIB = -L$$LIBCORE_ROOT -lcore
44-
LIBCORE_INC = $$LIBCORE_ROOT/src
44+
LIBCORE_INC = $$LIBCORE_ROOT/src $$top_builddir/libs/$$LIBCORE/src
4545

4646
LIBPARSERS = libparsers
4747
LIBPARSERS_ROOT = $$absolute_path($$PWD/libs/$$LIBPARSERS)
48-
LIBPARSERS_LIB = -L$$LIBPARSERS_ROOT -lparsers
49-
LIBPARSERS_INC = $$LIBPARSERS_ROOT/src
48+
LIBPARSERS_INC = $$LIBPARSERS_ROOT/src $$top_builddir/libs/$$LIBPARSERS/src
5049

5150
LIBGUI = libgui
5251
LIBGUI_ROOT = $$absolute_path($$PWD/libs/$$LIBGUI)
53-
LIBGUI_LIB = -L$$LIBGUI_ROOT -lgui
54-
LIBGUI_INC = $$LIBGUI_ROOT/src
52+
LIBGUI_INC = $$LIBGUI_ROOT/src $$top_builddir/libs/$$LIBGUI/src
5553

5654
LIBUTILS = libutils
5755
LIBUTILS_ROOT = $$absolute_path($$PWD/libs/$$LIBUTILS)
58-
LIBUTILS_LIB = -L$$LIBUTILS_ROOT -lutils
59-
LIBUTILS_INC = $$LIBUTILS_ROOT/src
56+
LIBUTILS_INC = $$LIBUTILS_ROOT/src $$top_builddir/libs/$$LIBUTILS/src
6057

6158
LIBCLI = libcli
6259
LIBCLI_ROOT = $$absolute_path($$PWD/libs/$$LIBCLI)
63-
LIBCLI_LIB = -L$$LIBCLI_ROOT -lcli
64-
LIBCLI_INC = $$LIBCLI_ROOT/src
60+
LIBCLI_INC = $$LIBCLI_ROOT/src $$top_builddir/libs/$$LIBCLI
61+
62+
macx|unix {
63+
LIBCANVAS_LIB = -L$$LIBCANVAS_ROOT -lcanvas
64+
LIBCONNECTOR_LIB = -L$$LIBCONNECTOR_ROOT -lconnector
65+
LIBCORE_LIB = -L$$LIBCORE_ROOT -lcore
66+
LIBPARSERS_LIB = -L$$LIBPARSERS_ROOT -lparsers
67+
LIBGUI_LIB = -L$$LIBGUI_ROOT -lgui
68+
LIBUTILS_LIB = -L$$LIBUTILS_ROOT -lutils
69+
LIBCLI_LIB = -L$$LIBCLI_ROOT -lcli
70+
}
71+
windows {
72+
CONFIG(release): c = release
73+
CONFIG(debug, debug|release): c = debug
74+
75+
LIBCANVAS_LIB = -L$$top_builddir/libs/libcanvas/$$c -lcanvas
76+
LIBCONNECTOR_LIB = -L$$top_builddir/libs/libconnector/$$c -lconnector
77+
LIBCORE_LIB = -L$$top_builddir/libs/libcore/$$c -lcore
78+
LIBPARSERS_LIB = -L$$top_builddir/libs/libparsers/$$c -lparsers
79+
LIBGUI_LIB = -L$$top_builddir/libs/libgui/$$c -lgui
80+
LIBUTILS_LIB = -L$$top_builddir/libs/libutils/$$c -lutils
81+
LIBCLI_LIB = -L$$top_builddir/libs/libcli/$$c -lcli
82+
}
6583

6684
# Set the flag passed to compiler to indicate a snapshot build
6785
isEqual(SNAPSHOT_BUILD, true): DEFINES+=SNAPSHOT_BUILD
@@ -80,7 +98,7 @@ PLUGINS_FOLDER=plugins
8098
isEqual(PRIVATE_PLUGINS, true) {
8199
DEFINES+=PRIVATE_PLUGINS_SYMBOLS
82100
PLUGINS_FOLDER=priv-plugins
83-
PRIV_RES_FOLDER=$$PWD/$$PLUGINS_FOLDER/res
101+
PRIV_RES_FOLDER=$$PWD/$$PLUGINS_FOLDER/res
84102
}
85103

86104
# Include the plugins subprojects only if exists
@@ -125,36 +143,36 @@ linux {
125143
# If the AppImage generation option is set
126144
isEqual(APPIMAGE_BUILD, true):{
127145

128-
# Set the flag passed to compiler to indicate a appimage build
129-
DEFINES+=APPIMAGE_BUILD
130-
131-
!defined(PREFIX, var): PREFIX = /usr/local/pgmodeler-appimage
132-
BINDIR = $$PREFIX
133-
PRIVATEBINDIR = $$PREFIX
134-
PRIVATELIBDIR = $$PREFIX/lib
135-
PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
136-
SHAREDIR = $$PREFIX
137-
CONFDIR = $$SHAREDIR/conf
138-
DOCDIR = $$SHAREDIR
139-
LANGDIR = $$SHAREDIR/lang
140-
SAMPLESDIR = $$SHAREDIR/samples
141-
SCHEMASDIR = $$SHAREDIR/schemas
146+
# Set the flag passed to compiler to indicate a appimage build
147+
DEFINES+=APPIMAGE_BUILD
148+
149+
!defined(PREFIX, var): PREFIX = /usr/local/pgmodeler-appimage
150+
BINDIR = $$PREFIX
151+
PRIVATEBINDIR = $$PREFIX
152+
PRIVATELIBDIR = $$PREFIX/lib
153+
PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
154+
SHAREDIR = $$PREFIX
155+
CONFDIR = $$SHAREDIR/conf
156+
DOCDIR = $$SHAREDIR
157+
LANGDIR = $$SHAREDIR/lang
158+
SAMPLESDIR = $$SHAREDIR/samples
159+
SCHEMASDIR = $$SHAREDIR/schemas
142160
}
143161

144162
!isEqual(APPIMAGE_BUILD, true):{
145-
# Default configuration for package pgModeler.
146-
# The default prefix is /usr/local
147-
!defined(PREFIX, var): PREFIX = /usr/local
148-
!defined(BINDIR, var): BINDIR = $$PREFIX/bin
149-
!defined(PRIVATEBINDIR, var): PRIVATEBINDIR = $$PREFIX/bin
150-
!defined(PRIVATELIBDIR, var): PRIVATELIBDIR = $$PREFIX/lib/pgmodeler
151-
!defined(PLUGINSDIR, var): PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
152-
!defined(SHAREDIR, var): SHAREDIR = $$PREFIX/share/pgmodeler
153-
!defined(CONFDIR, var): CONFDIR = $$SHAREDIR/conf
154-
!defined(DOCDIR, var): DOCDIR = $$SHAREDIR
155-
!defined(LANGDIR, var): LANGDIR = $$SHAREDIR/lang
156-
!defined(SAMPLESDIR, var): SAMPLESDIR = $$SHAREDIR/samples
157-
!defined(SCHEMASDIR, var): SCHEMASDIR = $$SHAREDIR/schemas
163+
# Default configuration for package pgModeler.
164+
# The default prefix is /usr/local
165+
!defined(PREFIX, var): PREFIX = /usr/local
166+
!defined(BINDIR, var): BINDIR = $$PREFIX/bin
167+
!defined(PRIVATEBINDIR, var): PRIVATEBINDIR = $$PREFIX/bin
168+
!defined(PRIVATELIBDIR, var): PRIVATELIBDIR = $$PREFIX/lib/pgmodeler
169+
!defined(PLUGINSDIR, var): PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
170+
!defined(SHAREDIR, var): SHAREDIR = $$PREFIX/share/pgmodeler
171+
!defined(CONFDIR, var): CONFDIR = $$SHAREDIR/conf
172+
!defined(DOCDIR, var): DOCDIR = $$SHAREDIR
173+
!defined(LANGDIR, var): LANGDIR = $$SHAREDIR/lang
174+
!defined(SAMPLESDIR, var): SAMPLESDIR = $$SHAREDIR/samples
175+
!defined(SCHEMASDIR, var): SCHEMASDIR = $$SHAREDIR/schemas
158176
}
159177

160178
# Specifies where to find the libraries at runtime
@@ -176,8 +194,8 @@ windows {
176194
# (e.g. inline static class members). Maybe it's a bug in the code is wrong (more likely)
177195
# or is a bug in the compiler? The fact is that reducing the executable/libs code
178196
# optmization causes the tool to work as expected.
179-
QMAKE_CXXFLAGS_RELEASE -= -O2
180-
QMAKE_CXXFLAGS_RELEASE *= -O0
197+
gcc:QMAKE_CXXFLAGS_RELEASE -= -O2
198+
gcc:QMAKE_CXXFLAGS_RELEASE *= -O0
181199

182200
# The default prefix is ./build
183201
!defined(PREFIX, var): PREFIX = $$PWD/build
@@ -225,7 +243,7 @@ DEFINES += BINDIR=\\\"$${BINDIR}\\\" \
225243
DOCDIR=\\\"$${DOCDIR}\\\" \
226244
LANGDIR=\\\"$${LANGDIR}\\\" \
227245
SAMPLESDIR=\\\"$${SAMPLESDIR}\\\" \
228-
SCHEMASDIR=\\\"$${SCHEMASDIR}\\\"
246+
SCHEMASDIR=\\\"$${SCHEMASDIR}\\\"
229247

230248

231249
# pgModeler depends on libpq and libxml2 this way to variables
@@ -243,22 +261,22 @@ linux: {
243261
dep_paths = "$$PGSQL_LIB" "$$XML_LIB" "$$PGSQL_INC" "$$XML_INC"
244262
if(count(dep_paths, 4)):{
245263
INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"
246-
has_dep_paths = true
264+
has_dep_paths = true
247265
}
248266

249267
# If not all of the PGSQL_??? and XML_??? vars are defined
250268
# Then we default to use pkg-config for libpq and libxml-2.0
251269
!defined(has_dep_paths,var): {
252270
CONFIG += link_pkgconfig
253-
PKGCONFIG = libpq libxml-2.0
254-
PGSQL_LIB = -lpq
255-
XML_LIB = -lxml2
271+
PKGCONFIG = libpq libxml-2.0
272+
PGSQL_LIB = -lpq
273+
XML_LIB = -lxml2
256274
}
257275
}
258276

259277
macx {
260-
!defined(PGSQL_LIB, var): PGSQL_LIB = /Library/PostgreSQL/15/lib/libpq.dylib
261-
!defined(PGSQL_INC, var): PGSQL_INC = /Library/PostgreSQL/15/include
278+
!defined(PGSQL_LIB, var): PGSQL_LIB = /Library/PostgreSQL/15/lib/libpq.dylib
279+
!defined(PGSQL_INC, var): PGSQL_INC = /Library/PostgreSQL/15/include
262280
!defined(XML_INC, var): XML_INC = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2
263281
!defined(XML_LIB, var): XML_LIB = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libxml2.tbd
264282
INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"

0 commit comments

Comments
 (0)