forked from pgmodeler/pgmodeler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pgmodeler.pro
146 lines (124 loc) · 3.68 KB
/
pgmodeler.pro
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
############################################################
# XML / PostgreSQL variables configuration #
# #
# PGSQL_LIB -> Full path to libpq.(so | dll | dylib) #
# PGSQL_INC -> Root path where PgSQL includes can be found #
# #
# XML_LIB -> Full path to libxml2.(so | dll | dylib) #
# XML_INC -> Root path where XML2 includes can be found #
############################################################
unix {
!macx:CONFIG += link_pkgconfig
!macx:PKGCONFIG = libpq libxml-2.0
!macx:PGSQL_LIB = -lpq
!macx:XML_LIB = -lxml2
}
macx {
PGSQL_LIB = /Library/PostgreSQL/9.2/lib/libpq.dylib
PGSQL_INC = /Library/PostgreSQL/9.2/include
XML_INC = /usr/include/libxml2
XML_LIB = /usr/lib/libxml2.dylib
}
windows {
PGSQL_LIB = C:/PostgreSQL/9.2/bin/libpq.dll
PGSQL_INC = C:/PostgreSQL/9.2/include
XML_INC = C:/Qt/Qt5.0.2/5.0.2/mingw47_32/include
XML_LIB = C:/Qt/Qt5.0.2/5.0.2/mingw47_32/bin/libxml2.dll
}
macx | windows {
!exists($$PGSQL_LIB) {
PKG_ERROR = "PostgreSQL libraries"
VARIABLE = "PGSQL_LIB"
VALUE = $$PGSQL_LIB
}
}
macx | windows {
!exists($$PGSQL_INC/libpq-fe.h) {
PKG_ERROR = "PostgreSQL headers"
VARIABLE = "PGSQL_INC"
VALUE = $$PGSQL_INC
}
}
macx | windows {
!exists($$XML_LIB) {
PKG_ERROR = "XML2 libraries"
VARIABLE = "XML_LIB"
VALUE = $$XML_LIB
}
}
macx | windows {
!exists($$XML_INC) {
PKG_ERROR = "XML2 headers"
VARIABLE = "XML_INC"
VALUE = $$XML_INC
}
}
macx | windows {
!isEmpty(PKG_ERROR) {
warning("$$PKG_ERROR were not found at \"$$VALUE\"!")
warning("Please correct the value of $$VARIABLE and try again!")
error("pgModeler compilation aborted.")
}
}
###########################
# Main variables settings #
###########################
CONFIG += ordered qt stl rtti exceptions warn_on c++11
#Additional configs on unix / windows
unix:CONFIG += x11
windows:CONFIG += windows
macx:CONFIG-=app_bundle
#Libraries extension and preffix for each platform
unix:LIB_PREFIX = lib
unix:LIB_EXT = so
windows:LIB_EXT = dll
macx:LIB_EXT = dylib
SUBDIRS = libutils \
libparsers \
libdbconnect \
libpgmodeler \
libobjrenderer \
libpgmodeler_ui \
crashhandler \
main-cli \
main \
plugins/dummy \
plugins/xml2object
QT += core widgets printsupport
TEMPLATE = subdirs
MOC_DIR = moc
OBJECTS_DIR = obj
UI_DIR = src
macx {
BASEDIR = $$PWD/build/pgmodeler.app/Contents
DESTDIR = $$BASEDIR/MacOS #Where the compiled executables are stored
LIBDESTDIR = $$BASEDIR/Frameworks #Where the compiled libs are stored
}
linux|windows {
DESTDIR = $$PWD/build
LIBDESTDIR = $$DESTDIR #On Linux and Windows the compiled libs resides on the same executable's dir
}
#Creating the project's libraries names based upon the running OS
LIBUTILS=$${LIB_PREFIX}utils.$${LIB_EXT}
LIBPARSERS=$${LIB_PREFIX}parsers.$${LIB_EXT}
LIBDBCONNECT=$${LIB_PREFIX}dbconnect.$${LIB_EXT}
LIBPGMODELER=$${LIB_PREFIX}pgmodeler.$${LIB_EXT}
LIBOBJRENDERER=$${LIB_PREFIX}objrenderer.$${LIB_EXT}
LIBPGMODELERUI=$${LIB_PREFIX}pgmodeler_ui.$${LIB_EXT}
INCLUDEPATH += $$XML_INC \
$$PGSQL_INC \
$$PWD/libutils/src \
$$PWD/libdbconnect/src \
$$PWD/libparsers/src \
$$PWD/libpgmodeler/src \
$$PWD/libobjrenderer/src \
$$PWD/libpgmodeler_ui/src
#Adding xml and PostgreSQL libs
LIBS = $$XML_LIB $$PGSQL_LIB
#Deployment configurations
pgmodeler.path = $$DESTDIR
pgmodeler.files = samples schemas lang conf README.md CHANGELOG.md LICENSE
unix {
!macx:pgmodeler.files += pgmodeler.vars
}
INSTALLS += pgmodeler