##// END OF EJS Templates
Mac install_name_tool corrected to find dynamic libraries from correct place, if INSTALL_ROOT is used....
Matti Paaso -
r2637:5d4e58d46862
parent child
Show More
@@ -1,257 +1,257
1 1 !include( ../config.pri ):error( "Couldn't find the config.pri file!" )
2 2
3 3 ############################# BUILD CONFIG ######################################
4 4
5 5 TARGET = $$LIBRARY_NAME
6 6 DESTDIR = $$CHART_BUILD_LIB_DIR
7 7 TEMPLATE = lib
8 8 QT = core gui
9 9 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10 10 DEFINES += QTCOMMERCIALCHART_LIBRARY
11 11 win32:CONFIG += create_prl
12 12 # treat warnings as errors
13 13 win32-msvc*: {
14 14 QMAKE_CXXFLAGS += /WX
15 15 } else {
16 16 # QMAKE_CXXFLAGS += -Werror
17 17 }
18 18
19 19 unix:!qnx {
20 20 QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
21 21 }
22 22
23 23 ############################# DEPEDENCES ########################################
24 24
25 25 win32-msvc*: LIBS += User32.lib
26 26 LIBS -= -l$$LIBRARY_NAME
27 27 INCLUDEPATH += ../include .
28 28
29 29 ############################# SOURCES ##########################################
30 30
31 31 SOURCES += \
32 32 $$PWD/chartdataset.cpp \
33 33 $$PWD/chartpresenter.cpp \
34 34 $$PWD/chartthememanager.cpp \
35 35 $$PWD/qchart.cpp \
36 36 $$PWD/qchartview.cpp \
37 37 $$PWD/qabstractseries.cpp \
38 38 $$PWD/chartbackground.cpp \
39 39 $$PWD/chartelement.cpp \
40 40 $$PWD/chartitem.cpp \
41 41 $$PWD/scroller.cpp \
42 42 $$PWD/charttitle.cpp \
43 43 $$PWD/qpolarchart.cpp
44 44 PRIVATE_HEADERS += \
45 45 $$PWD/chartdataset_p.h \
46 46 $$PWD/chartitem_p.h \
47 47 $$PWD/chartpresenter_p.h \
48 48 $$PWD/chartthememanager_p.h \
49 49 $$PWD/chartbackground_p.h \
50 50 $$PWD/chartelement_p.h \
51 51 $$PWD/chartconfig_p.h \
52 52 $$PWD/qchart_p.h \
53 53 $$PWD/qchartview_p.h \
54 54 $$PWD/scroller_p.h \
55 55 $$PWD/qabstractseries_p.h \
56 56 $$PWD/charttitle_p.h \
57 57 $$PWD/charthelpers_p.h
58 58 PUBLIC_HEADERS += \
59 59 $$PWD/qchart.h \
60 60 $$PWD/qchartglobal.h \
61 61 $$PWD/qabstractseries.h \
62 62 $$PWD/qchartview.h \
63 63 $$PWD/chartsnamespace.h \
64 64 $$PWD/qpolarchart.h
65 65
66 66 include(animations/animations.pri)
67 67 include(areachart/areachart.pri)
68 68 include(axis/axis.pri)
69 69 include(domain/domain.pri)
70 70 include(barchart/barchart.pri)
71 71 include(legend/legend.pri)
72 72 include(linechart/linechart.pri)
73 73 include(piechart/piechart.pri)
74 74 include(scatterchart/scatter.pri)
75 75 include(splinechart/splinechart.pri)
76 76 include(themes/themes.pri)
77 77 include(xychart/xychart.pri)
78 78 include(layout/layout.pri)
79 79 include(boxplotchart/boxplotchart.pri)
80 80
81 81 HEADERS += $$PUBLIC_HEADERS
82 82 HEADERS += $$PRIVATE_HEADERS
83 83 HEADERS += $$THEMES
84 84
85 85 ############################# BUILD PATH ##########################################
86 86
87 87 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
88 88 MOC_DIR = $$CHART_BUILD_DIR/lib
89 89 UI_DIR = $$CHART_BUILD_DIR/lib
90 90 RCC_DIR = $$CHART_BUILD_DIR/lib
91 91
92 92 ############################# PUBLIC HEADERS GENERATOR ##########################################
93 93
94 94 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
95 95 {
96 96 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
97 97 contains(QMAKE_HOST.os, Windows) {
98 98 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
99 99 }else{
100 100 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
101 101 }
102 102 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
103 103 system($$command)
104 104 }
105 105
106 106 for(file, PUBLIC_HEADERS) {
107 107 name = $$split(file,'/')
108 108 name = $$last(name)
109 109 class = "$$cat($$file)"
110 110 class = $$find(class,class)
111 111 !isEmpty(class){
112 112 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
113 113 class = $$member(class,1)
114 114 class = $$split(class,' ')
115 115 class = $$replace(class,' ','')
116 116 class = $$member(class,0)
117 117 contains(QMAKE_HOST.os, Windows) {
118 118 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
119 119 }else{
120 120 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
121 121 }
122 122 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
123 123 system($$command)
124 124 }
125 125 }
126 126
127 127 ############################# INSTALLERS ##########################################
128 128
129 129 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
130 130 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
131 131 INSTALLS += public_headers
132 132
133 133 install_build_public_headers.name = build_public_headers
134 134 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
135 135 install_build_public_headers.input = PUBLIC_HEADERS
136 136 install_build_public_headers.commands = $$QMAKE_COPY \
137 137 ${QMAKE_FILE_NAME} \
138 138 $$CHART_BUILD_PUBLIC_HEADER_DIR
139 139 install_build_public_headers.CONFIG += target_predeps \
140 140 no_link
141 141
142 142 install_build_private_headers.name = build_private_headers
143 143 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
144 144 install_build_private_headers.input = PRIVATE_HEADERS
145 145 install_build_private_headers.commands = $$QMAKE_COPY \
146 146 ${QMAKE_FILE_NAME} \
147 147 $$CHART_BUILD_PRIVATE_HEADER_DIR
148 148 install_build_private_headers.CONFIG += target_predeps \
149 149 no_link
150 150
151 151 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
152 152 install_build_private_headers \
153 153
154 154 win32:{
155 155 bintarget.CONFIG += no_check_exist
156 156 !staticlib: {
157 157 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
158 158 }
159 159 win32-msvc*:CONFIG(debug, debug|release): {
160 160 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
161 161 }
162 162 bintarget.path = $$[QT_INSTALL_BINS]
163 163
164 164 libtarget.CONFIG += no_check_exist
165 165 libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl
166 166 win32-msvc*: {
167 167 libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib
168 168 } else {
169 169 libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a
170 170 }
171 171 libtarget.path = $$[QT_INSTALL_LIBS]
172 172
173 173 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
174 174 INSTALLS += bintarget libtarget
175 175 }else{
176 176 target.path=$$[QT_INSTALL_LIBS]
177 177 INSTALLS += target
178 178 }
179 179
180 180 mac: !staticlib: {
181 181 # Update the name (id) of the library on OSX to point to the lib path
182 182 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
183 183 QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME"
184 184
185 185 # Update the name (id) of the installed library on OSX to point to the installation path
186 186 postinstall.path = $$[QT_INSTALL_LIBS]
187 postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME"
187 postinstall.extra = "install_name_tool -id $(INSTALL_ROOT)"/"$$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $(INSTALL_ROOT)"/"$$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME"
188 188 INSTALLS += postinstall
189 189 }
190 190
191 191 ################################ DEVELOPMENT BUILD ##########################################
192 192 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
193 193 # This is the case at least with shadow builds.
194 194 # http://qt-project.org/wiki/jom
195 195
196 196 development_build:!win32-msvc*:{
197 197 chartversion.target = $$PWD/qchartversion_p.h
198 198
199 199 unix:{
200 200 chartversion.commands = @echo \
201 201 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
202 202 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
203 203 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
204 204 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
205 205 $${LITERAL_HASH}endif \" \
206 206 > \
207 207 $$chartversion.target;
208 208 }else{
209 209 chartversion.commands = @echo \
210 210 "const char *buildTime = \"%date%_%time%\" ; \
211 211 const char *gitHead = \"unknown\" ; " \
212 212 > \
213 213 $$chartversion.target
214 214 }
215 215
216 216 chartversion.depends = $$HEADERS \
217 217 $$SOURCES
218 218
219 219 PRE_TARGETDEPS += $$chartversion.target
220 220 QMAKE_CLEAN += $$PWD/qchartversion_p.h
221 221 QMAKE_EXTRA_TARGETS += chartversion
222 222 }
223 223
224 224 ############################### CLEAN ###########################################
225 225
226 226 unix:QMAKE_DISTCLEAN += -r \
227 227 $$CHART_BUILD_HEADER_DIR \
228 228 $$CHART_BUILD_LIB_DIR
229 229 win32:QMAKE_DISTCLEAN += /Q \
230 230 $$CHART_BUILD_HEADER_DIR \
231 231 $$CHART_BUILD_LIB_DIR
232 232
233 233 ############################## COVERAGE #########################################
234 234
235 235 unix:coverage:{
236 236
237 237 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
238 238 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
239 239
240 240 LIBS += -lgcov
241 241
242 242 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
243 243 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
244 244
245 245 preparecoverage.target = prepare_coverage
246 246 preparecoverage.depends = all
247 247 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
248 248 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
249 249
250 250 gencoverage.target = gen_coverage
251 251 gencoverage.depends = all
252 252 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
253 253 lcov -e ../coverage/base.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/base.info;\
254 254 lcov -e ../coverage/src.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/src.info;\
255 255 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
256 256 }
257 257
General Comments 0
You need to be logged in to leave comments. Login now