##// END OF EJS Templates
Fix name (id) of the installed library on OSX
Tero Ahola -
r1421:84c273c1c468
parent child
Show More
@@ -1,95 +1,93
1 1
2 2 LIBRARY_NAME = QtCommercialChart
3 3 coverage: CONFIG+=debug
4 4
5 5 ##################### SHADOW CONFIG #################################################
6 6
7 7 !contains($${PWD}, $${OUT_PWD}){
8 8 search = "$$PWD:::"
9 9 temp = $$split(search,"/")
10 10 temp = $$last(temp)
11 11 path = $$replace(search,$$temp,'')
12 12 temp = $$split(OUT_PWD,$$path)
13 13 temp = $$split(temp,'/')
14 14 temp = $$first(temp)
15 15 path = "$${path}$${temp}"
16 16 SHADOW=$$path
17 17 }else{
18 18 SHADOW=$$PWD
19 19 CONFIG-=development_build
20 20 }
21 21
22 22 ##################### BUILD PATHS ##################################################
23 23
24 24 CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include
25 25 CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private
26 26 CHART_BUILD_LIB_DIR = $$SHADOW/lib
27 27 CHART_BUILD_DIR = $$SHADOW/build
28 28 CHART_BUILD_BIN_DIR = $$SHADOW/bin
29 29 CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR/QtCommercial/Chart
30 30 CHART_BUILD_DOC_DIR = $$SHADOW/doc
31 31
32 32 win32:{
33 33 CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\")
34 34 CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\")
35 35 CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
36 36 CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
37 37 CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\")
38 38 CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\")
39 39 CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
40 40 }
41 41
42 42 mac: {
43 43 # TODO: The following qmake flags are a work-around to make QtCommercial Charts compile on
44 44 # QtCommercial 4.8. On the other hand Charts builds successfully with Qt open source 4.8
45 45 # without these definitions, so this is probably a configuration issue on QtCommercial 4.8;
46 46 # it should probably define the minimum OSX version to be 10.5...
47 47 QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
48 48 QMAKE_LFLAGS *= -mmacosx-version-min=10.5
49
50 CHART_BUILD_LIB_DIR = $$CHART_BUILD_BIN_DIR
51 49 }
52 50
53 51 ##################### DEVELOPMENT BUILD ###################################################
54 52
55 53 development_build: {
56 54 DEFINES+=DEVELOPMENT_BUILD
57 55 CONFIG+=debug_and_release
58 56 }
59 57
60 58
61 59 ##################### BUILD CONFIG ########################################################
62 60
63 61 !system_build:{
64 62
65 63 INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR
66 64
67 65 !win32: {
68 66 LIBS += -L $$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR
69 67 }else{
70 68 win32-msvc*: {
71 69 # hack fix for error:
72 70 # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'"
73 71 QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR
74 72 }else{
75 73 LIBS += -L $$CHART_BUILD_LIB_DIR
76 74 }
77 75 }
78 76
79 77 CONFIG(debug, debug|release) {
80 78 mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug)
81 79 win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d)
82 80 }
83 81
84 82 LIBS += -l$$LIBRARY_NAME
85 83 } else {
86 84 CONFIG += qtcommercialchart
87 85 }
88 86
89 87 ##################### UNIT TESTS ##############################################################
90 88
91 89 CONFIG(debug, debug|release) {
92 90 CONFIG+=test_private
93 91 DEFINES+=BUILD_PRIVATE_UNIT_TESTS
94 92 }
95 93
@@ -1,242 +1,247
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 DEFINES += QTCOMMERCIALCHART_LIBRARY
10 10 win32:CONFIG += create_prl
11 11 # treat warnings as errors
12 12 win32-msvc*: {
13 13 QMAKE_CXXFLAGS += /WX
14 14 } else {
15 15 QMAKE_CXXFLAGS += -Werror
16 16 }
17 17
18 18 unix:{
19 19 QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
20 20 }
21 21
22 22 ############################# DEPEDENCES ########################################
23 23
24 24 win32-msvc*: LIBS += User32.lib
25 25 LIBS -= -l$$LIBRARY_NAME
26 26 INCLUDEPATH += ../include .
27 27
28 28 ############################# SOURCES ##########################################
29 29
30 30 SOURCES += \
31 31 $$PWD/chartdataset.cpp \
32 32 $$PWD/chartpresenter.cpp \
33 33 $$PWD/charttheme.cpp \
34 34 $$PWD/domain.cpp \
35 35 $$PWD/qchart.cpp \
36 36 $$PWD/qchartview.cpp \
37 37 $$PWD/qabstractseries.cpp \
38 38 $$PWD/chartbackground.cpp \
39 39 $$PWD/chart.cpp \
40 40 $$PWD/scroller.cpp
41 41 PRIVATE_HEADERS += \
42 42 $$PWD/chartdataset_p.h \
43 43 $$PWD/chartitem_p.h \
44 44 $$PWD/chartpresenter_p.h \
45 45 $$PWD/charttheme_p.h \
46 46 $$PWD/domain_p.h \
47 47 $$PWD/chartbackground_p.h \
48 48 $$PWD/chart_p.h \
49 49 $$PWD/chartconfig_p.h \
50 50 $$PWD/qchart_p.h \
51 51 $$PWD/qchartview_p.h \
52 52 $$PWD/scroller_p.h \
53 53 $$PWD/qabstractseries_p.h
54 54 PUBLIC_HEADERS += \
55 55 $$PWD/qchart.h \
56 56 $$PWD/qchartglobal.h \
57 57 $$PWD/qabstractseries.h \
58 58 $$PWD/qchartview.h
59 59
60 60 include(animations/animations.pri)
61 61 include(areachart/areachart.pri)
62 62 include(axis/axis.pri)
63 63 include(barchart/barchart.pri)
64 64 include(legend/legend.pri)
65 65 include(linechart/linechart.pri)
66 66 include(piechart/piechart.pri)
67 67 include(scatterchart/scatter.pri)
68 68 include(splinechart/splinechart.pri)
69 69 include(themes/themes.pri)
70 70 include(xychart/xychart.pri)
71 71
72 72 HEADERS += $$PUBLIC_HEADERS
73 73 HEADERS += $$PRIVATE_HEADERS
74 74 HEADERS += $$THEMES
75 75
76 76 ############################# BUILD PATH ##########################################
77 77
78 78 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
79 79 MOC_DIR = $$CHART_BUILD_DIR/lib
80 80 UI_DIR = $$CHART_BUILD_DIR/lib
81 81 RCC_DIR = $$CHART_BUILD_DIR/lib
82 82
83 83 ############################# PUBLIC HEADERS GENERTOR ##########################################
84 84
85 85 #this is very primitive and lame parser , TODO: make perl script insted
86 86 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
87 87 {
88 88 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
89 89 win32:{
90 90 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
91 91 }else{
92 92 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
93 93 }
94 94 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
95 95 system($$command)
96 96 }
97 97
98 98 for(file, PUBLIC_HEADERS) {
99 99 name = $$split(file,'/')
100 100 name = $$last(name)
101 101 class = "$$cat($$file)"
102 102 class = $$find(class,class)
103 103 !isEmpty(class){
104 104 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
105 105 class = $$member(class,1)
106 106 class = $$split(class,' ')
107 107 class = $$replace(class,' ','')
108 108 class = $$member(class,0)
109 109 win32:{
110 110 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
111 111 }else{
112 112 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
113 113 }
114 114 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
115 115 system($$command)
116 116 }
117 117 }
118 118
119 119 ############################# INSTALLERS ##########################################
120 120
121 121 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
122 122 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
123 123 INSTALLS += public_headers
124 124
125 125 install_build_public_headers.name = build_public_headers
126 126 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
127 127 install_build_public_headers.input = PUBLIC_HEADERS
128 128 install_build_public_headers.commands = $$QMAKE_COPY \
129 129 ${QMAKE_FILE_NAME} \
130 130 $$CHART_BUILD_PUBLIC_HEADER_DIR
131 131 install_build_public_headers.CONFIG += target_predeps \
132 132 no_link
133 133
134 134 install_build_private_headers.name = buld_private_headers
135 135 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
136 136 install_build_private_headers.input = PRIVATE_HEADERS
137 137 install_build_private_headers.commands = $$QMAKE_COPY \
138 138 ${QMAKE_FILE_NAME} \
139 139 $$CHART_BUILD_PRIVATE_HEADER_DIR
140 140 install_build_private_headers.CONFIG += target_predeps \
141 141 no_link
142 142
143 143 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
144 144 install_build_private_headers \
145 145
146 146 win32:{
147 147 bintarget.CONFIG += no_check_exist
148 148 bintarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
149 149 win32-msvc*:CONFIG(debug, debug|release): {
150 150 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
151 151 }
152 152 bintarget.path = $$[QT_INSTALL_BINS]
153 153
154 154 libtarget.CONFIG += no_check_exist
155 155 libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl
156 156 win32-msvc*: {
157 157 libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib
158 158 } else {
159 159 libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a
160 160 }
161 161 libtarget.path = $$[QT_INSTALL_LIBS]
162 162
163 163 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
164 164 INSTALLS += bintarget libtarget
165 165 }else{
166 166 target.path=$$[QT_INSTALL_LIBS]
167 167 INSTALLS += target
168 168 }
169 169
170 170 mac: {
171 # Update the name (id) of the library on OSX to point to the lib dir
171 # Update the name (id) of the library on OSX to point to the lib path
172 172 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
173 173 QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME"
174
175 # Update the name (id) of the installed library on OSX to point to the installation path
176 postinstall.path = $$[QT_INSTALL_LIBS]
177 postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME"
178 INSTALLS += postinstall
174 179 }
175 180
176 181 ################################ DEVELOPMENT BUILD ##########################################
177 182 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
178 183 # This is the case at least with shadow builds.
179 184 # http://qt-project.org/wiki/jom
180 185
181 186 development_build:!win32-msvc*:{
182 187 chartversion.target = $$PWD/qchartversion_p.h
183 188
184 189 unix:{
185 190 chartversion.commands = @echo \
186 191 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
187 192 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
188 193 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
189 194 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
190 195 $${LITERAL_HASH}endif \" \
191 196 > \
192 197 $$chartversion.target;
193 198 }else{
194 199 chartversion.commands = @echo \
195 200 "const char *buildTime = \"%date%_%time%\" ; \
196 201 const char *gitHead = \"unknown\" ; " \
197 202 > \
198 203 $$chartversion.target
199 204 }
200 205
201 206 chartversion.depends = $$HEADERS \
202 207 $$SOURCES
203 208
204 209 PRE_TARGETDEPS += $$chartversion.target
205 210 QMAKE_CLEAN += $$PWD/qchartversion_p.h
206 211 QMAKE_EXTRA_TARGETS += chartversion
207 212 }
208 213
209 214 ############################### CLEAN ###########################################
210 215
211 216 unix:QMAKE_DISTCLEAN += -r \
212 217 $$CHART_BUILD_HEADER_DIR \
213 218 $$CHART_BUILD_LIB_DIR
214 219 win32:QMAKE_DISTCLEAN += /Q \
215 220 $$CHART_BUILD_HEADER_DIR \
216 221 $$CHART_BUILD_LIB_DIR
217 222
218 223 ############################## COVERAGE #########################################
219 224
220 225 unix:coverage:{
221 226
222 227 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
223 228 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
224 229
225 230 LIBS += -lgcov
226 231
227 232 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
228 233 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
229 234
230 235 preparecoverage.target = prepare_coverage
231 236 preparecoverage.depends = all
232 237 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
233 238 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
234 239
235 240 gencoverage.target = gen_coverage
236 241 gencoverage.depends = all
237 242 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
238 243 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;\
239 244 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;\
240 245 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
241 246 }
242 247
General Comments 0
You need to be logged in to leave comments. Login now