Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
top_srcdir=$$PWD
top_builddir=$$shadowed($$PWD)
1 change: 0 additions & 1 deletion apps/apps.pri
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ DEPENDPATH += $$LIBGUI_ROOT \

unix:LIBS += $$QMAKE_LIBS_EXECINFO
windows:RCC_DIR=src/
windows:DESTDIR=$$PWD

isEqual(PRIVATE_PLUGINS, false) {
windows:RC_FILE=res/windows_ico.qrc
Expand Down
6 changes: 3 additions & 3 deletions apps/pgmodeler-se/pgmodeler-se.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ DEPENDPATH += ../pgmodeler \
# Forcing the linker to use the objects files generated
# during the compilation of the main executable since
# pgmodeler-se uses the same application class
OBJECTS += ../pgmodeler/obj/pgmodelerapp.o \
../pgmodeler/obj/moc_pgmodelerapp.o
windows: OBJECTS += ../pgmodeler/obj/pgmodelerapp.obj ../pgmodeler/obj/moc_pgmodelerapp.obj
else: OBJECTS += ../pgmodeler/obj/pgmodelerapp.o ../pgmodeler/obj/moc_pgmodelerapp.o

# Deployment settings
target.path = $$PRIVATEBINDIR
INSTALLS = target

# Print the current build settins (see pgmodeler.pri)
# Print the current build settings (see pgmodeler.pri)
printBuildDetails()
1 change: 0 additions & 1 deletion libs/libcanvas/libcanvas.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = canvas
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += CANVAS_SYMBOLS
Expand Down
1 change: 0 additions & 1 deletion libs/libcli/libcli.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = cli
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += CLI_SYMBOLS
Expand Down
1 change: 0 additions & 1 deletion libs/libconnector/libconnector.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = connector
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += CONNECTOR_SYMBOLS
Expand Down
1 change: 0 additions & 1 deletion libs/libcore/libcore.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = core
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += CORE_SYMBOLS
Expand Down
4 changes: 2 additions & 2 deletions libs/libgui/libgui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ isEqual(PRIVATE_PLUGINS, false) {
RESOURCES += res/resources.qrc

windows:RCC_DIR += src
windows:DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += GUI_SYMBOLS
Expand Down Expand Up @@ -382,7 +381,8 @@ INCLUDEPATH += $$LIBCANVAS_INC \
$$PWD/src/settings \
$$PWD/src/tools \
$$PWD/src/utils \
$$PWD/src/widgets
$$PWD/src/widgets \
$$PWD/src

DEPENDPATH += $$LIBCANVAS_ROOT \
$$LIBCONNECTOR_ROOT \
Expand Down
1 change: 0 additions & 1 deletion libs/libparsers/libparsers.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = parsers
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += PARSERS_SYMBOLS
Expand Down
1 change: 0 additions & 1 deletion libs/libutils/libutils.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include(../../pgmodeler.pri)

TEMPLATE = lib
TARGET = utils
windows: DESTDIR = $$PWD

# Enables shared library symbols exporting
DEFINES += UTILS_SYMBOLS
Expand Down
130 changes: 74 additions & 56 deletions pgmodeler.pri
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,77 @@ OBJECTS_DIR = obj
UI_DIR = src

contains(CONFIG, debug):{
DEFINES+=PGMODELER_DEBUG
DEFINES+=PGMODELER_DEBUG

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

msvc:DEFINES+=__PRETTY_FUNCTION__=__FUNCTION__

# Disables all the APIs deprecated before Qt 6.4.0
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060400
!defined(NO_CHECK_CURR_VER, var):DEFINES+=CHECK_CURR_VER

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

# Store the absolute paths to library subprojects to be referenced in other .pro files
# *_ROOT -> the path to the root folder of the subproject
# *_LIB -> the libary flags (-L -l) (LIBS on qmake) passed to the compiler that points to the library generated from a subproject
# *_LIB -> the library flags (-L -l) (LIBS on qmake) passed to the compiler that points to the library generated from a subproject
# *_INC -> the path to the source code folder (src), used by the flag -I (INCLUDEPATH on qmake) passed to the compiler

LIBCANVAS = libcanvas
LIBCANVAS_ROOT = $$absolute_path($$PWD/libs/$$LIBCANVAS)
LIBCANVAS_LIB = -L$$LIBCANVAS_ROOT -lcanvas
LIBCANVAS_INC = $$LIBCANVAS_ROOT/src
LIBCANVAS_INC = $$LIBCANVAS_ROOT/src $$top_builddir/libs/$$LIBCANVAS/src

LIBCONNECTOR = libconnector
LIBCONNECTOR_ROOT = $$absolute_path($$PWD/libs/$$LIBCONNECTOR)
LIBCONNECTOR_LIB = -L$$LIBCONNECTOR_ROOT -lconnector
LIBCONNECTOR_INC = $$LIBCONNECTOR_ROOT/src
LIBCONNECTOR_INC = $$LIBCONNECTOR_ROOT/src $$top_builddir/libs/$$LIBCONNECTOR/src

LIBCORE = libcore
LIBCORE_ROOT = $$absolute_path($$PWD/libs/$$LIBCORE)
LIBCORE_LIB = -L$$LIBCORE_ROOT -lcore
LIBCORE_INC = $$LIBCORE_ROOT/src
LIBCORE_INC = $$LIBCORE_ROOT/src $$top_builddir/libs/$$LIBCORE/src

LIBPARSERS = libparsers
LIBPARSERS_ROOT = $$absolute_path($$PWD/libs/$$LIBPARSERS)
LIBPARSERS_LIB = -L$$LIBPARSERS_ROOT -lparsers
LIBPARSERS_INC = $$LIBPARSERS_ROOT/src
LIBPARSERS_INC = $$LIBPARSERS_ROOT/src $$top_builddir/libs/$$LIBPARSERS/src

LIBGUI = libgui
LIBGUI_ROOT = $$absolute_path($$PWD/libs/$$LIBGUI)
LIBGUI_LIB = -L$$LIBGUI_ROOT -lgui
LIBGUI_INC = $$LIBGUI_ROOT/src
LIBGUI_INC = $$LIBGUI_ROOT/src $$top_builddir/libs/$$LIBGUI/src

LIBUTILS = libutils
LIBUTILS_ROOT = $$absolute_path($$PWD/libs/$$LIBUTILS)
LIBUTILS_LIB = -L$$LIBUTILS_ROOT -lutils
LIBUTILS_INC = $$LIBUTILS_ROOT/src
LIBUTILS_INC = $$LIBUTILS_ROOT/src $$top_builddir/libs/$$LIBUTILS/src

LIBCLI = libcli
LIBCLI_ROOT = $$absolute_path($$PWD/libs/$$LIBCLI)
LIBCLI_LIB = -L$$LIBCLI_ROOT -lcli
LIBCLI_INC = $$LIBCLI_ROOT/src
LIBCLI_INC = $$LIBCLI_ROOT/src $$top_builddir/libs/$$LIBCLI

macx|unix {
LIBCANVAS_LIB = -L$$LIBCANVAS_ROOT -lcanvas
LIBCONNECTOR_LIB = -L$$LIBCONNECTOR_ROOT -lconnector
LIBCORE_LIB = -L$$LIBCORE_ROOT -lcore
LIBPARSERS_LIB = -L$$LIBPARSERS_ROOT -lparsers
LIBGUI_LIB = -L$$LIBGUI_ROOT -lgui
LIBUTILS_LIB = -L$$LIBUTILS_ROOT -lutils
LIBCLI_LIB = -L$$LIBCLI_ROOT -lcli
}
windows {
CONFIG(release): c = release
CONFIG(debug, debug|release): c = debug

LIBCANVAS_LIB = -L$$top_builddir/libs/libcanvas/$$c -lcanvas
LIBCONNECTOR_LIB = -L$$top_builddir/libs/libconnector/$$c -lconnector
LIBCORE_LIB = -L$$top_builddir/libs/libcore/$$c -lcore
LIBPARSERS_LIB = -L$$top_builddir/libs/libparsers/$$c -lparsers
LIBGUI_LIB = -L$$top_builddir/libs/libgui/$$c -lgui
LIBUTILS_LIB = -L$$top_builddir/libs/libutils/$$c -lutils
LIBCLI_LIB = -L$$top_builddir/libs/libcli/$$c -lcli
}

# Set the flag passed to compiler to indicate a snapshot build
isEqual(SNAPSHOT_BUILD, true): DEFINES+=SNAPSHOT_BUILD
Expand All @@ -80,7 +98,7 @@ PLUGINS_FOLDER=plugins
isEqual(PRIVATE_PLUGINS, true) {
DEFINES+=PRIVATE_PLUGINS_SYMBOLS
PLUGINS_FOLDER=priv-plugins
PRIV_RES_FOLDER=$$PWD/$$PLUGINS_FOLDER/res
PRIV_RES_FOLDER=$$PWD/$$PLUGINS_FOLDER/res
}

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

# Set the flag passed to compiler to indicate a appimage build
DEFINES+=APPIMAGE_BUILD

!defined(PREFIX, var): PREFIX = /usr/local/pgmodeler-appimage
BINDIR = $$PREFIX
PRIVATEBINDIR = $$PREFIX
PRIVATELIBDIR = $$PREFIX/lib
PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
SHAREDIR = $$PREFIX
CONFDIR = $$SHAREDIR/conf
DOCDIR = $$SHAREDIR
LANGDIR = $$SHAREDIR/lang
SAMPLESDIR = $$SHAREDIR/samples
SCHEMASDIR = $$SHAREDIR/schemas
# Set the flag passed to compiler to indicate a appimage build
DEFINES+=APPIMAGE_BUILD

!defined(PREFIX, var): PREFIX = /usr/local/pgmodeler-appimage
BINDIR = $$PREFIX
PRIVATEBINDIR = $$PREFIX
PRIVATELIBDIR = $$PREFIX/lib
PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
SHAREDIR = $$PREFIX
CONFDIR = $$SHAREDIR/conf
DOCDIR = $$SHAREDIR
LANGDIR = $$SHAREDIR/lang
SAMPLESDIR = $$SHAREDIR/samples
SCHEMASDIR = $$SHAREDIR/schemas
}

!isEqual(APPIMAGE_BUILD, true):{
# Default configuration for package pgModeler.
# The default prefix is /usr/local
!defined(PREFIX, var): PREFIX = /usr/local
!defined(BINDIR, var): BINDIR = $$PREFIX/bin
!defined(PRIVATEBINDIR, var): PRIVATEBINDIR = $$PREFIX/bin
!defined(PRIVATELIBDIR, var): PRIVATELIBDIR = $$PREFIX/lib/pgmodeler
!defined(PLUGINSDIR, var): PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
!defined(SHAREDIR, var): SHAREDIR = $$PREFIX/share/pgmodeler
!defined(CONFDIR, var): CONFDIR = $$SHAREDIR/conf
!defined(DOCDIR, var): DOCDIR = $$SHAREDIR
!defined(LANGDIR, var): LANGDIR = $$SHAREDIR/lang
!defined(SAMPLESDIR, var): SAMPLESDIR = $$SHAREDIR/samples
!defined(SCHEMASDIR, var): SCHEMASDIR = $$SHAREDIR/schemas
# Default configuration for package pgModeler.
# The default prefix is /usr/local
!defined(PREFIX, var): PREFIX = /usr/local
!defined(BINDIR, var): BINDIR = $$PREFIX/bin
!defined(PRIVATEBINDIR, var): PRIVATEBINDIR = $$PREFIX/bin
!defined(PRIVATELIBDIR, var): PRIVATELIBDIR = $$PREFIX/lib/pgmodeler
!defined(PLUGINSDIR, var): PLUGINSDIR = $$PREFIX/lib/pgmodeler/plugins
!defined(SHAREDIR, var): SHAREDIR = $$PREFIX/share/pgmodeler
!defined(CONFDIR, var): CONFDIR = $$SHAREDIR/conf
!defined(DOCDIR, var): DOCDIR = $$SHAREDIR
!defined(LANGDIR, var): LANGDIR = $$SHAREDIR/lang
!defined(SAMPLESDIR, var): SAMPLESDIR = $$SHAREDIR/samples
!defined(SCHEMASDIR, var): SCHEMASDIR = $$SHAREDIR/schemas
}

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

# The default prefix is ./build
!defined(PREFIX, var): PREFIX = $$PWD/build
Expand Down Expand Up @@ -225,7 +243,7 @@ DEFINES += BINDIR=\\\"$${BINDIR}\\\" \
DOCDIR=\\\"$${DOCDIR}\\\" \
LANGDIR=\\\"$${LANGDIR}\\\" \
SAMPLESDIR=\\\"$${SAMPLESDIR}\\\" \
SCHEMASDIR=\\\"$${SCHEMASDIR}\\\"
SCHEMASDIR=\\\"$${SCHEMASDIR}\\\"


# pgModeler depends on libpq and libxml2 this way to variables
Expand All @@ -243,22 +261,22 @@ linux: {
dep_paths = "$$PGSQL_LIB" "$$XML_LIB" "$$PGSQL_INC" "$$XML_INC"
if(count(dep_paths, 4)):{
INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"
has_dep_paths = true
has_dep_paths = true
}

# If not all of the PGSQL_??? and XML_??? vars are defined
# Then we default to use pkg-config for libpq and libxml-2.0
!defined(has_dep_paths,var): {
CONFIG += link_pkgconfig
PKGCONFIG = libpq libxml-2.0
PGSQL_LIB = -lpq
XML_LIB = -lxml2
PKGCONFIG = libpq libxml-2.0
PGSQL_LIB = -lpq
XML_LIB = -lxml2
}
}

macx {
!defined(PGSQL_LIB, var): PGSQL_LIB = /Library/PostgreSQL/15/lib/libpq.dylib
!defined(PGSQL_INC, var): PGSQL_INC = /Library/PostgreSQL/15/include
!defined(PGSQL_LIB, var): PGSQL_LIB = /Library/PostgreSQL/15/lib/libpq.dylib
!defined(PGSQL_INC, var): PGSQL_INC = /Library/PostgreSQL/15/include
!defined(XML_INC, var): XML_INC = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2
!defined(XML_LIB, var): XML_LIB = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libxml2.tbd
INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"
Expand Down