##// END OF EJS Templates
minor. add debug flag for coverage
Michal Klocek -
r1087:332ed569a36e
parent child
Show More
@@ -1,61 +1,59
1 1 !include(config.pri) {
2 2 error('Missing config.pri')
3 3 }
4 4
5 5 TEMPLATE = subdirs
6 6 SUBDIRS = src qmlplugin examples demos test
7 7
8 8 development_build: message('Development build')
9 9
10 10 !system_build:{
11 11 message('Configured for local build against local libs...')
12 12 message('You can run "make" to build qchart library, examples, demos and plugin...')
13 13 message('You can run "make install" to install qchart in qt sdk...')
14 14 } else {
15 15 message('Running build aginst system libs...')
16 16 message('Building only charts library...')
17 17 message('Afterwards you can run "cd examples; qmake ; make " to build examples.')
18 18 SUBDIRS = src
19 19 }
20 20
21 21 CONFIG += ordered
22 22 QMAKE_CXXFLAGS += -g -Wall
23 23 unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html
24 24 win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html
25 25
26 26 # install feature file
27 27 feature.path = $$[QT_INSTALL_DATA]/mkspecs/features
28 28 feature.files = $$PWD/features/qtcommercialchart.prf
29 29 INSTALLS += feature
30 30
31 31 docs.target = docs
32 32 win32:{
33 33 docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR\\qcharts.qdocconf
34 34 }else{
35 35 docs.commands = qdoc3 $$CHART_BUILD_DOC_DIR/qcharts.qdocconf
36 36 }
37 37 docs.depends = FORCE
38 38 QMAKE_EXTRA_TARGETS += docs
39 39
40 coverage:{
41
42 CONFIG+=debug
40 unix:coverage:{
43 41 QMAKE_DISTCLEAN += -r ./coverage
44 42 QMAKE_CLEAN += build/*.gcda build/*.gcno
45 43 QMAKE_EXTRA_TARGETS += buildcoverage runcoverage gencoverage
46
44
47 45 buildcoverage.target = build_coverage
48 46 buildcoverage.depends = all
49 47 buildcoverage.commands = mkdir -p ./coverage; \
50 48 make -C src prepare_coverage;
51 49
52 50 runcoverage.target = run_coverage
53 51 runcoverage.depends = buildcoverage
54 52 runcoverage.commands = for f in `ls ./bin/test/tst_*` ; do echo "processing \$\$f test..."; \$\$f >> unit.log; done ;
55 53
56 54 gencoverage.target = gen_coverage
57 55 gencoverage.depends = runcoverage
58 56 gencoverage.commands = make -C src gen_coverage; \
59 57 genhtml -o ./coverage ./coverage/coverage.info --prefix $$PWD
60 58 }
61 59
@@ -1,109 +1,111
1 1
2 2 LIBRARY_NAME = QtCommercialChart
3 coverage: CONFIG+=debug
3 4
4 5 ##################### SHADOW CONFIG #################################################
5 6
6 7 !contains($${PWD}, $${OUT_PWD}){
7 8 search = "$$PWD:::"
8 9 temp = $$split(search,"/")
9 10 temp = $$last(temp)
10 11 path = $$replace(search,$$temp,'')
11 12 temp = $$split(OUT_PWD,$$path)
12 13 temp = $$split(temp,'/')
13 14 temp = $$first(temp)
14 15 path = "$${path}$${temp}"
15 16 SHADOW=$$path
16 17 }else{
17 18 SHADOW=$$PWD
18 19 CONFIG-=development_build
19 20 }
20 21
21 22 ##################### BUILD PATHS ##################################################
22 23
23 24 CHART_BUILD_PUBLIC_HEADER_DIR = $$SHADOW/include
24 25 CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private
25 26 CHART_BUILD_LIB_DIR = $$SHADOW/lib
26 27 CHART_BUILD_DIR = $$SHADOW/build
27 28 CHART_BUILD_BIN_DIR = $$SHADOW/bin
28 29 CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_BIN_DIR/QtCommercial/Chart
29 30 CHART_BUILD_DOC_DIR = $$SHADOW/doc
30 31
31 32 win32:{
32 33 CHART_BUILD_PUBLIC_HEADER_DIR = $$replace(CHART_BUILD_PUBLIC_HEADER_DIR, "/","\\")
33 34 CHART_BUILD_PRIVATE_HEADER_DIR = $$replace(CHART_BUILD_PRIVATE_HEADER_DIR, "/","\\")
34 35 CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
35 36 CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
36 37 CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\")
37 38 CHART_BUILD_DOC_DIR = $$replace(CHART_BUILD_DOC_DIR, "/","\\")
38 39 CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
39 40 }
40 41
41 42 mac: {
42 43 # TODO: The following qmake flags are a work-around to make QtCommercial Charts compile on
43 44 # QtCommercial 4.8. On the other hand Charts builds successfully with Qt open source 4.8
44 45 # without these definitions, so this is probably a configuration issue on QtCommercial 4.8;
45 46 # it should probably define the minimum OSX version to be 10.5...
46 47 QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
47 48 QMAKE_LFLAGS *= -mmacosx-version-min=10.5
48 49
49 50 CHART_BUILD_LIB_DIR = $$CHART_BUILD_BIN_DIR
50 51 }
51 52
52 53 ##################### DEVELOPMENT BUILD ###################################################
53 54
54 55 development_build: {
55 56 DEFINES+=DEVELOPMENT_BUILD
56 57 CONFIG+=debug_and_release
57 58 }
58 59
59 60
60 61 ##################### BUILD CONFIG ########################################################
61 62
62 63 !system_build:{
63 64
64 65 INCLUDEPATH += $$CHART_BUILD_PUBLIC_HEADER_DIR
65 66
66 67 !win32: {
67 68 LIBS += -L $$CHART_BUILD_LIB_DIR -Wl,-rpath,$$CHART_BUILD_LIB_DIR
68 69 }else{
69 70 win32-msvc*: {
70 71 # hack fix for error:
71 72 # "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'"
72 73 QMAKE_LIBDIR += $$CHART_BUILD_LIB_DIR
73 74 }else{
74 75 LIBS += -L $$CHART_BUILD_LIB_DIR
75 76 }
76 77 }
77 78
78 79 CONFIG(debug, debug|release) {
79 80 mac: LIBRARY_NAME = $$join(LIBRARY_NAME,,,_debug)
80 81 win32: LIBRARY_NAME = $$join(LIBRARY_NAME,,,d)
81 82 }
82 83
83 84 LIBS += -l$$LIBRARY_NAME
84 85
85 86 mac: {
86 87 # This is a hack; we define variables for easier install_name_tool calls from project files of OSX executables/libraries
87 88 # install_name_tool is used to update the dependencies to chart library to match the local build folder
88 89 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
89 90 CONFIG(debug, debug|release) {
90 91 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
91 92 }
92 93 MAC_POST_LINK_PREFIX = install_name_tool -change $$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME
93 94 MAC_DEMOS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
94 95 MAC_EXAMPLES_BIN_DIR = $$CHART_BUILD_BIN_DIR"/"$$TARGET".app/Contents/MacOS/"$$TARGET
95 96 MAC_TESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/test/"$$TARGET".app/Contents/MacOS/"$$TARGET
96 97 MAC_AUTOTESTS_BIN_DIR = $$CHART_BUILD_BIN_DIR"/test/tst_"$$TARGET".app/Contents/MacOS/tst_"$$TARGET
97 98 MAC_PLUGINS_BIN_DIR = $$CHART_BUILD_PLUGIN_DIR"/lib"$$TARGET".dylib"
98 99 }
99 100
100 101 } else {
101 102 CONFIG += qtcommercialchart
102 103 }
103 104
104 105 ##################### UNIT TESTS ##############################################################
105 106
106 107 CONFIG(debug, debug|release) {
107 108 CONFIG+=test_private
108 109 DEFINES+=BUILD_PRIVATE_UNIT_TESTS
109 110 }
111
@@ -1,236 +1,235
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\\*.dll
149 149 win32-msvc*:CONFIG(debug, debug|release): {
150 150 bintarget.files += $$CHART_BUILD_LIB_DIR\\*.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\\*.prl
156 156 win32-msvc*: {
157 157 libtarget.files += $$CHART_BUILD_LIB_DIR\\*.lib
158 158 } else {
159 159 libtarget.files += $$CHART_BUILD_LIB_DIR\\*.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 ################################ DEVELOPMENT BUILD ##########################################
170 170 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
171 171 # This is the case at least with shadow builds.
172 172 # http://qt-project.org/wiki/jom
173 173
174 174 development_build:!win32-msvc*:{
175 175 chartversion.target = $$PWD/qchartversion_p.h
176 176
177 177 unix:{
178 178 chartversion.commands = @echo \
179 179 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
180 180 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
181 181 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
182 182 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
183 183 $${LITERAL_HASH}endif \" \
184 184 > \
185 185 $$chartversion.target;
186 186 }else{
187 187 chartversion.commands = @echo \
188 188 "const char *buildTime = \"%date%_%time%\" ; \
189 189 const char *gitHead = \"unknown\" ; " \
190 190 > \
191 191 $$chartversion.target
192 192 }
193 193
194 194 chartversion.depends = $$HEADERS \
195 195 $$SOURCES
196 196
197 197 PRE_TARGETDEPS += $$chartversion.target
198 198 QMAKE_CLEAN += $$PWD/qchartversion_p.h
199 199 QMAKE_EXTRA_TARGETS += chartversion
200 200 }
201 201
202 202 ############################### CLEAN ###########################################
203 203
204 204 unix:QMAKE_DISTCLEAN += -r \
205 205 $$CHART_BUILD_HEADER_DIR \
206 206 $$CHART_BUILD_LIB_DIR
207 207 win32:QMAKE_DISTCLEAN += /Q \
208 208 $$CHART_BUILD_HEADER_DIR \
209 209 $$CHART_BUILD_LIB_DIR
210 210
211 211 ############################## COVERAGE #########################################
212 212
213 coverage:{
213 unix:coverage:{
214 214
215 215 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
216 216 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
217 217
218 218 LIBS += -lgcov
219 CONFIG += debug
220 219
221 220 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
222 221 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
223 222
224 223 preparecoverage.target = prepare_coverage
225 224 preparecoverage.depends = all
226 225 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
227 226 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
228 227
229 228 gencoverage.target = gen_coverage
230 229 gencoverage.depends = all
231 230 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
232 231 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;\
233 232 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;\
234 233 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
235 234 }
236 235
General Comments 0
You need to be logged in to leave comments. Login now