@@ -1,82 +1,82 | |||
|
1 | 1 | !include(config.pri) { |
|
2 | 2 | error('Missing config.pri') |
|
3 | 3 | } |
|
4 | 4 | |
|
5 | 5 | TEMPLATE = subdirs |
|
6 | 6 | SUBDIRS = src plugins demos examples tests |
|
7 | 7 | |
|
8 | 8 | development_build: message('Development build') |
|
9 | 9 | |
|
10 | 10 | CONFIG += ordered |
|
11 | 11 | QMAKE_CXXFLAGS += -g -Wall |
|
12 | 12 | unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html |
|
13 | 13 | win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html |
|
14 | 14 | |
|
15 | 15 | # install feature file |
|
16 | 16 | feature.path = $$[QT_INSTALL_DATA]/mkspecs/features |
|
17 | 17 | feature.files = $$PWD/features/qtcommercialchart.prf |
|
18 | 18 | INSTALLS += feature |
|
19 | 19 | |
|
20 | 20 | # docs |
|
21 | 21 | CHARTS_VERSION = 1.2.1 |
|
22 | 22 | CHARTS_VERSION_TAG = 121 |
|
23 | 23 | |
|
24 | win32: { | |
|
24 | contains(QMAKE_HOST.os, Windows) { | |
|
25 | 25 | QDOC_CONF = $$CHART_BUILD_DOC_DIR\\qcharts.qdocconf |
|
26 |
win32-g++ |
|
|
26 | win32-g++|qnx { | |
|
27 | 27 | VERSION_SETTINGS = \ |
|
28 | 28 | set QT_CHARTS_VERSION=$$CHARTS_VERSION&& set QT_CHARTS_VERSION_TAG=$$CHARTS_VERSION_TAG&& |
|
29 | 29 | } else { |
|
30 | 30 | VERSION_SETTINGS = \ |
|
31 | 31 | set QT_CHARTS_VERSION=$$CHARTS_VERSION $$escape_expand(\\n\\t) \ |
|
32 | 32 | set QT_CHARTS_VERSION_TAG=$$CHARTS_VERSION_TAG $$escape_expand(\\n\\t) |
|
33 | 33 | } |
|
34 | 34 | } else { |
|
35 | 35 | QDOC_CONF = $$CHART_BUILD_DOC_DIR/qcharts.qdocconf |
|
36 | 36 | VERSION_SETTINGS = \ |
|
37 | 37 | QT_CHARTS_VERSION=$$CHARTS_VERSION QT_CHARTS_VERSION_TAG=$$CHARTS_VERSION_TAG |
|
38 | 38 | } |
|
39 | 39 | |
|
40 | 40 | contains(QT_MAJOR_VERSION, 5) { |
|
41 | 41 | QDOC_CMD = qdoc |
|
42 | 42 | HELPGENERATOR_CMD = qhelpgenerator -platform minimal |
|
43 | 43 | } else { |
|
44 | 44 | QDOC_CMD = qdoc3 |
|
45 | 45 | HELPGENERATOR_CMD = qhelpgenerator |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | QHP_FILE = doc/html/qtcommercialcharts.qhp |
|
49 | 49 | QCH_FILE = doc/qch/qtcommercialcharts.qch |
|
50 | 50 | |
|
51 | 51 | docs.target = docs |
|
52 | 52 | docs.depends = qch_docs FORCE |
|
53 | 53 | qch_docs.target = qch_docs |
|
54 | 54 | qch_docs.commands = $$HELPGENERATOR_CMD $$QHP_FILE -o $$QCH_FILE |
|
55 | 55 | qch_docs.depends = html_docs FORCE |
|
56 | 56 | html_docs.target = html_docs |
|
57 | 57 | html_docs.commands = $$VERSION_SETTINGS $$QDOC_CMD $$QDOC_CONF |
|
58 | 58 | html_docs.depends = FORCE |
|
59 | 59 | |
|
60 | 60 | QMAKE_EXTRA_TARGETS += docs qch_docs html_docs |
|
61 | 61 | |
|
62 | 62 | # coverage |
|
63 | 63 | unix:coverage:{ |
|
64 | 64 | QMAKE_DISTCLEAN += -r ./coverage |
|
65 | 65 | QMAKE_CLEAN += build/*.gcda build/*.gcno |
|
66 | 66 | QMAKE_EXTRA_TARGETS += buildcoverage runcoverage gencoverage |
|
67 | 67 | |
|
68 | 68 | buildcoverage.target = build_coverage |
|
69 | 69 | buildcoverage.depends = all |
|
70 | 70 | buildcoverage.commands = mkdir -p ./coverage; \ |
|
71 | 71 | make -C src prepare_coverage; |
|
72 | 72 | |
|
73 | 73 | runcoverage.target = run_coverage |
|
74 | 74 | runcoverage.depends = buildcoverage |
|
75 | 75 | runcoverage.commands = for f in `ls ./bin/tst_*` ; do echo "processing \$\$f test..."; \$\$f >> unit.log; done ; exit 0; |
|
76 | 76 | |
|
77 | 77 | gencoverage.target = gen_coverage |
|
78 | 78 | gencoverage.depends = runcoverage |
|
79 | 79 | gencoverage.commands = make -C src gen_coverage; \ |
|
80 | 80 | genhtml -o ./coverage ./coverage/coverage.info --prefix $$PWD |
|
81 | 81 | } |
|
82 | 82 |
@@ -1,255 +1,255 | |||
|
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 | unix:{ | |
|
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/chartlayout.cpp \ |
|
43 | 43 | $$PWD/charttitle.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/chartlayout_p.h \ |
|
57 | 57 | $$PWD/charttitle_p.h \ |
|
58 | 58 | $$PWD/charthelpers_p.h |
|
59 | 59 | PUBLIC_HEADERS += \ |
|
60 | 60 | $$PWD/qchart.h \ |
|
61 | 61 | $$PWD/qchartglobal.h \ |
|
62 | 62 | $$PWD/qabstractseries.h \ |
|
63 | 63 | $$PWD/qchartview.h \ |
|
64 | 64 | $$PWD/chartsnamespace.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 | |
|
79 | 79 | HEADERS += $$PUBLIC_HEADERS |
|
80 | 80 | HEADERS += $$PRIVATE_HEADERS |
|
81 | 81 | HEADERS += $$THEMES |
|
82 | 82 | |
|
83 | 83 | ############################# BUILD PATH ########################################## |
|
84 | 84 | |
|
85 | 85 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
86 | 86 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
87 | 87 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
88 | 88 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
89 | 89 | |
|
90 | 90 | ############################# PUBLIC HEADERS GENERATOR ########################################## |
|
91 | 91 | |
|
92 | 92 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) |
|
93 | 93 | { |
|
94 | 94 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) |
|
95 | win32:{ | |
|
95 | contains(QMAKE_HOST.os, Windows) { | |
|
96 | 96 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
97 | 97 | }else{ |
|
98 | 98 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
99 | 99 | } |
|
100 | 100 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal |
|
101 | 101 | system($$command) |
|
102 | 102 | } |
|
103 | 103 | |
|
104 | 104 | for(file, PUBLIC_HEADERS) { |
|
105 | 105 | name = $$split(file,'/') |
|
106 | 106 | name = $$last(name) |
|
107 | 107 | class = "$$cat($$file)" |
|
108 | 108 | class = $$find(class,class) |
|
109 | 109 | !isEmpty(class){ |
|
110 | 110 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) |
|
111 | 111 | class = $$member(class,1) |
|
112 | 112 | class = $$split(class,' ') |
|
113 | 113 | class = $$replace(class,' ','') |
|
114 | 114 | class = $$member(class,0) |
|
115 | win32:{ | |
|
115 | contains(QMAKE_HOST.os, Windows) { | |
|
116 | 116 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
117 | 117 | }else{ |
|
118 | 118 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
119 | 119 | } |
|
120 | 120 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class |
|
121 | 121 | system($$command) |
|
122 | 122 | } |
|
123 | 123 | } |
|
124 | 124 | |
|
125 | 125 | ############################# INSTALLERS ########################################## |
|
126 | 126 | |
|
127 | 127 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
128 | 128 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS |
|
129 | 129 | INSTALLS += public_headers |
|
130 | 130 | |
|
131 | 131 | install_build_public_headers.name = build_public_headers |
|
132 | 132 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
133 | 133 | install_build_public_headers.input = PUBLIC_HEADERS |
|
134 | 134 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
135 | 135 | ${QMAKE_FILE_NAME} \ |
|
136 | 136 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
137 | 137 | install_build_public_headers.CONFIG += target_predeps \ |
|
138 | 138 | no_link |
|
139 | 139 | |
|
140 | 140 | install_build_private_headers.name = build_private_headers |
|
141 | 141 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
142 | 142 | install_build_private_headers.input = PRIVATE_HEADERS |
|
143 | 143 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
144 | 144 | ${QMAKE_FILE_NAME} \ |
|
145 | 145 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
146 | 146 | install_build_private_headers.CONFIG += target_predeps \ |
|
147 | 147 | no_link |
|
148 | 148 | |
|
149 | 149 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
150 | 150 | install_build_private_headers \ |
|
151 | 151 | |
|
152 | 152 | win32:{ |
|
153 | 153 | bintarget.CONFIG += no_check_exist |
|
154 | 154 | !staticlib: { |
|
155 | 155 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll |
|
156 | 156 | } |
|
157 | 157 | win32-msvc*:CONFIG(debug, debug|release): { |
|
158 | 158 | bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb |
|
159 | 159 | } |
|
160 | 160 | bintarget.path = $$[QT_INSTALL_BINS] |
|
161 | 161 | |
|
162 | 162 | libtarget.CONFIG += no_check_exist |
|
163 | 163 | libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl |
|
164 | 164 | win32-msvc*: { |
|
165 | 165 | libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib |
|
166 | 166 | } else { |
|
167 | 167 | libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a |
|
168 | 168 | } |
|
169 | 169 | libtarget.path = $$[QT_INSTALL_LIBS] |
|
170 | 170 | |
|
171 | 171 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR |
|
172 | 172 | INSTALLS += bintarget libtarget |
|
173 | 173 | }else{ |
|
174 | 174 | target.path=$$[QT_INSTALL_LIBS] |
|
175 | 175 | INSTALLS += target |
|
176 | 176 | } |
|
177 | 177 | |
|
178 | 178 | mac: !staticlib: { |
|
179 | 179 | # Update the name (id) of the library on OSX to point to the lib path |
|
180 | 180 | MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib" |
|
181 | 181 | QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME" |
|
182 | 182 | |
|
183 | 183 | # Update the name (id) of the installed library on OSX to point to the installation path |
|
184 | 184 | postinstall.path = $$[QT_INSTALL_LIBS] |
|
185 | 185 | postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME" |
|
186 | 186 | INSTALLS += postinstall |
|
187 | 187 | } |
|
188 | 188 | |
|
189 | 189 | ################################ DEVELOPMENT BUILD ########################################## |
|
190 | 190 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. |
|
191 | 191 | # This is the case at least with shadow builds. |
|
192 | 192 | # http://qt-project.org/wiki/jom |
|
193 | 193 | |
|
194 | 194 | development_build:!win32-msvc*:{ |
|
195 | 195 | chartversion.target = $$PWD/qchartversion_p.h |
|
196 | 196 | |
|
197 | 197 | unix:{ |
|
198 | 198 | chartversion.commands = @echo \ |
|
199 | 199 | \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ |
|
200 | 200 | $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ |
|
201 | 201 | const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ |
|
202 | 202 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ |
|
203 | 203 | $${LITERAL_HASH}endif \" \ |
|
204 | 204 | > \ |
|
205 | 205 | $$chartversion.target; |
|
206 | 206 | }else{ |
|
207 | 207 | chartversion.commands = @echo \ |
|
208 | 208 | "const char *buildTime = \"%date%_%time%\" ; \ |
|
209 | 209 | const char *gitHead = \"unknown\" ; " \ |
|
210 | 210 | > \ |
|
211 | 211 | $$chartversion.target |
|
212 | 212 | } |
|
213 | 213 | |
|
214 | 214 | chartversion.depends = $$HEADERS \ |
|
215 | 215 | $$SOURCES |
|
216 | 216 | |
|
217 | 217 | PRE_TARGETDEPS += $$chartversion.target |
|
218 | 218 | QMAKE_CLEAN += $$PWD/qchartversion_p.h |
|
219 | 219 | QMAKE_EXTRA_TARGETS += chartversion |
|
220 | 220 | } |
|
221 | 221 | |
|
222 | 222 | ############################### CLEAN ########################################### |
|
223 | 223 | |
|
224 | 224 | unix:QMAKE_DISTCLEAN += -r \ |
|
225 | 225 | $$CHART_BUILD_HEADER_DIR \ |
|
226 | 226 | $$CHART_BUILD_LIB_DIR |
|
227 | 227 | win32:QMAKE_DISTCLEAN += /Q \ |
|
228 | 228 | $$CHART_BUILD_HEADER_DIR \ |
|
229 | 229 | $$CHART_BUILD_LIB_DIR |
|
230 | 230 | |
|
231 | 231 | ############################## COVERAGE ######################################### |
|
232 | 232 | |
|
233 | 233 | unix:coverage:{ |
|
234 | 234 | |
|
235 | 235 | QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage |
|
236 | 236 | QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage |
|
237 | 237 | |
|
238 | 238 | LIBS += -lgcov |
|
239 | 239 | |
|
240 | 240 | QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info |
|
241 | 241 | QMAKE_EXTRA_TARGETS += preparecoverage gencoverage |
|
242 | 242 | |
|
243 | 243 | preparecoverage.target = prepare_coverage |
|
244 | 244 | preparecoverage.depends = all |
|
245 | 245 | preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ |
|
246 | 246 | lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; |
|
247 | 247 | |
|
248 | 248 | gencoverage.target = gen_coverage |
|
249 | 249 | gencoverage.depends = all |
|
250 | 250 | gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ |
|
251 | 251 | 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;\ |
|
252 | 252 | 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;\ |
|
253 | 253 | lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; |
|
254 | 254 | } |
|
255 | 255 |
General Comments 0
You need to be logged in to leave comments.
Login now