##// END OF EJS Templates
Using namespace macro is now added to ui_*.h files when using designer plugin
Marek Rosa -
r1750:82bf60f5058e
parent child
Show More
@@ -0,0 +1,28
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 #ifndef MACROINCLUDE_H_
22 #define MACROINCLUDE_H_
23
24 // this is needed by the designer plugin.
25
26 QTCOMMERCIALCHART_USE_NAMESPACE
27
28 #endif /* MACROINCLUDE_H_ */
@@ -1,78 +1,88
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "qchartsplugin.h"
21 #include "qchartsplugin.h"
22 #include "qchartview.h"
22 #include "qchartview.h"
23 #include <QtPlugin>
23 #include <QtPlugin>
24
24
25 QTCOMMERCIALCHART_USE_NAMESPACE
25 QTCOMMERCIALCHART_USE_NAMESPACE
26
26
27 QChartsPlugin::QChartsPlugin(QObject *parent) :
27 QChartsPlugin::QChartsPlugin(QObject *parent) :
28 QObject(parent)
28 QObject(parent)
29 {
29 {
30 // TODO Auto-generated constructor stub
30 // TODO Auto-generated constructor stub
31 }
31 }
32
32
33 QChartsPlugin::~QChartsPlugin()
33 QChartsPlugin::~QChartsPlugin()
34 {
34 {
35 // TODO Auto-generated destructor stub
35 // TODO Auto-generated destructor stub
36 }
36 }
37
37
38 QString QChartsPlugin::name() const
38 QString QChartsPlugin::name() const
39 {
39 {
40 return "QChartView";
40 return "QChartView";
41 }
41 }
42
42
43 QString QChartsPlugin::includeFile() const
43 QString QChartsPlugin::includeFile() const
44 {
44 {
45 return "<qchartview.h>";
45 #ifdef linux
46 QString myNewLine = "\n";
47 #endif
48 #ifdef WIN32
49 QString myNewLine = "\n\r";
50 #endif
51 #ifdef __APPLE__
52 QString myNewLine = "\n";
53 #endif
54
55 return "<qchartview.h>" + myNewLine + "#include <chartsnamespace.h>";
46 }
56 }
47
57
48 QString QChartsPlugin::group() const
58 QString QChartsPlugin::group() const
49 {
59 {
50 return tr("QCharts Widgets");
60 return tr("QCharts Widgets");
51 }
61 }
52
62
53 QIcon QChartsPlugin::icon() const
63 QIcon QChartsPlugin::icon() const
54 {
64 {
55 return QIcon(":/images/qcharts.png");
65 return QIcon(":/images/qcharts.png");
56 }
66 }
57
67
58 QString QChartsPlugin::toolTip() const
68 QString QChartsPlugin::toolTip() const
59 {
69 {
60 return tr("An qcharts view widget");
70 return tr("An qcharts view widget");
61 }
71 }
62
72
63 QString QChartsPlugin::whatsThis() const
73 QString QChartsPlugin::whatsThis() const
64 {
74 {
65 return tr("This widget is presents QChartView widget");
75 return tr("This widget is presents QChartView widget");
66 }
76 }
67
77
68 bool QChartsPlugin::isContainer() const
78 bool QChartsPlugin::isContainer() const
69 {
79 {
70 return false;
80 return false;
71 }
81 }
72
82
73 QWidget* QChartsPlugin::createWidget(QWidget *parent)
83 QWidget* QChartsPlugin::createWidget(QWidget *parent)
74 {
84 {
75 return new QChartView(new QChart(), parent);
85 return new QChartView(new QChart(), parent);
76 }
86 }
77
87
78 Q_EXPORT_PLUGIN2(qtcommercialchart, QChartsPlugin)
88 Q_EXPORT_PLUGIN2(qtcommercialchart, QChartsPlugin)
@@ -1,251 +1,253
1 !include( ../config.pri ):error( "Couldn't find the config.pri file!" )
1 !include( ../config.pri ):error( "Couldn't find the config.pri file!" )
2
2
3 ############################# BUILD CONFIG ######################################
3 ############################# BUILD CONFIG ######################################
4
4
5 TARGET = $$LIBRARY_NAME
5 TARGET = $$LIBRARY_NAME
6 DESTDIR = $$CHART_BUILD_LIB_DIR
6 DESTDIR = $$CHART_BUILD_LIB_DIR
7 TEMPLATE = lib
7 TEMPLATE = lib
8 QT = core gui
8 QT = core gui
9 DEFINES += QTCOMMERCIALCHART_LIBRARY
9 DEFINES += QTCOMMERCIALCHART_LIBRARY
10 win32:CONFIG += create_prl
10 win32:CONFIG += create_prl
11 # treat warnings as errors
11 # treat warnings as errors
12 win32-msvc*: {
12 win32-msvc*: {
13 QMAKE_CXXFLAGS += /WX
13 QMAKE_CXXFLAGS += /WX
14 } else {
14 } else {
15 QMAKE_CXXFLAGS += -Werror
15 QMAKE_CXXFLAGS += -Werror
16 }
16 }
17
17
18 unix:{
18 unix:{
19 QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
19 QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
20 }
20 }
21
21
22 ############################# DEPEDENCES ########################################
22 ############################# DEPEDENCES ########################################
23
23
24 win32-msvc*: LIBS += User32.lib
24 win32-msvc*: LIBS += User32.lib
25 LIBS -= -l$$LIBRARY_NAME
25 LIBS -= -l$$LIBRARY_NAME
26 INCLUDEPATH += ../include .
26 INCLUDEPATH += ../include .
27
27
28 ############################# SOURCES ##########################################
28 ############################# SOURCES ##########################################
29
29
30 SOURCES += \
30 SOURCES += \
31 $$PWD/chartdataset.cpp \
31 $$PWD/chartdataset.cpp \
32 $$PWD/chartpresenter.cpp \
32 $$PWD/chartpresenter.cpp \
33 $$PWD/charttheme.cpp \
33 $$PWD/charttheme.cpp \
34 $$PWD/domain.cpp \
34 $$PWD/domain.cpp \
35 $$PWD/qchart.cpp \
35 $$PWD/qchart.cpp \
36 $$PWD/qchartview.cpp \
36 $$PWD/qchartview.cpp \
37 $$PWD/qabstractseries.cpp \
37 $$PWD/qabstractseries.cpp \
38 $$PWD/chartbackground.cpp \
38 $$PWD/chartbackground.cpp \
39 $$PWD/chartelement.cpp \
39 $$PWD/chartelement.cpp \
40 $$PWD/scroller.cpp \
40 $$PWD/scroller.cpp \
41 $$PWD/chartlayout.cpp
41 $$PWD/chartlayout.cpp
42 PRIVATE_HEADERS += \
42 PRIVATE_HEADERS += \
43 $$PWD/chartdataset_p.h \
43 $$PWD/chartdataset_p.h \
44 $$PWD/chartitem_p.h \
44 $$PWD/chartitem_p.h \
45 $$PWD/chartpresenter_p.h \
45 $$PWD/chartpresenter_p.h \
46 $$PWD/charttheme_p.h \
46 $$PWD/charttheme_p.h \
47 $$PWD/domain_p.h \
47 $$PWD/domain_p.h \
48 $$PWD/chartbackground_p.h \
48 $$PWD/chartbackground_p.h \
49 $$PWD/chartelement_p.h \
49 $$PWD/chartelement_p.h \
50 $$PWD/chartconfig_p.h \
50 $$PWD/chartconfig_p.h \
51 $$PWD/qchart_p.h \
51 $$PWD/qchart_p.h \
52 $$PWD/qchartview_p.h \
52 $$PWD/qchartview_p.h \
53 $$PWD/scroller_p.h \
53 $$PWD/scroller_p.h \
54 $$PWD/qabstractseries_p.h \
54 $$PWD/qabstractseries_p.h \
55 $$PWD/chartlayout_p.h
55 $$PWD/chartlayout_p.h
56
56 PUBLIC_HEADERS += \
57 PUBLIC_HEADERS += \
57 $$PWD/qchart.h \
58 $$PWD/qchart.h \
58 $$PWD/qchartglobal.h \
59 $$PWD/qchartglobal.h \
59 $$PWD/qabstractseries.h \
60 $$PWD/qabstractseries.h \
60 $$PWD/qchartview.h
61 $$PWD/qchartview.h \
62 $$PWD/chartsnamespace.h
61
63
62 include(animations/animations.pri)
64 include(animations/animations.pri)
63 include(areachart/areachart.pri)
65 include(areachart/areachart.pri)
64 include(axis/axis.pri)
66 include(axis/axis.pri)
65 include(barchart/barchart.pri)
67 include(barchart/barchart.pri)
66 include(legend/legend.pri)
68 include(legend/legend.pri)
67 include(linechart/linechart.pri)
69 include(linechart/linechart.pri)
68 include(piechart/piechart.pri)
70 include(piechart/piechart.pri)
69 include(scatterchart/scatter.pri)
71 include(scatterchart/scatter.pri)
70 include(splinechart/splinechart.pri)
72 include(splinechart/splinechart.pri)
71 include(themes/themes.pri)
73 include(themes/themes.pri)
72 include(xychart/xychart.pri)
74 include(xychart/xychart.pri)
73
75
74 HEADERS += $$PUBLIC_HEADERS
76 HEADERS += $$PUBLIC_HEADERS
75 HEADERS += $$PRIVATE_HEADERS
77 HEADERS += $$PRIVATE_HEADERS
76 HEADERS += $$THEMES
78 HEADERS += $$THEMES
77
79
78 ############################# BUILD PATH ##########################################
80 ############################# BUILD PATH ##########################################
79
81
80 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
82 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
81 MOC_DIR = $$CHART_BUILD_DIR/lib
83 MOC_DIR = $$CHART_BUILD_DIR/lib
82 UI_DIR = $$CHART_BUILD_DIR/lib
84 UI_DIR = $$CHART_BUILD_DIR/lib
83 RCC_DIR = $$CHART_BUILD_DIR/lib
85 RCC_DIR = $$CHART_BUILD_DIR/lib
84
86
85 ############################# PUBLIC HEADERS GENERTOR ##########################################
87 ############################# PUBLIC HEADERS GENERTOR ##########################################
86
88
87 #this is very primitive and lame parser , TODO: make perl script insted
89 #this is very primitive and lame parser , TODO: make perl script insted
88 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
90 !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal)
89 {
91 {
90 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
92 system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR)
91 win32:{
93 win32:{
92 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
94 command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
93 }else{
95 }else{
94 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
96 command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal"
95 }
97 }
96 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
98 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal
97 system($$command)
99 system($$command)
98 }
100 }
99
101
100 for(file, PUBLIC_HEADERS) {
102 for(file, PUBLIC_HEADERS) {
101 name = $$split(file,'/')
103 name = $$split(file,'/')
102 name = $$last(name)
104 name = $$last(name)
103 class = "$$cat($$file)"
105 class = "$$cat($$file)"
104 class = $$find(class,class)
106 class = $$find(class,class)
105 !isEmpty(class){
107 !isEmpty(class){
106 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
108 class = $$split(class,QTCOMMERCIALCHART_EXPORT)
107 class = $$member(class,1)
109 class = $$member(class,1)
108 class = $$split(class,' ')
110 class = $$split(class,' ')
109 class = $$replace(class,' ','')
111 class = $$replace(class,' ','')
110 class = $$member(class,0)
112 class = $$member(class,0)
111 win32:{
113 win32:{
112 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
114 command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
113 }else{
115 }else{
114 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
116 command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class"
115 }
117 }
116 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
118 PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class
117 system($$command)
119 system($$command)
118 }
120 }
119 }
121 }
120
122
121 ############################# INSTALLERS ##########################################
123 ############################# INSTALLERS ##########################################
122
124
123 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
125 public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart
124 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
126 public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS
125 INSTALLS += public_headers
127 INSTALLS += public_headers
126
128
127 install_build_public_headers.name = build_public_headers
129 install_build_public_headers.name = build_public_headers
128 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
130 install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h
129 install_build_public_headers.input = PUBLIC_HEADERS
131 install_build_public_headers.input = PUBLIC_HEADERS
130 install_build_public_headers.commands = $$QMAKE_COPY \
132 install_build_public_headers.commands = $$QMAKE_COPY \
131 ${QMAKE_FILE_NAME} \
133 ${QMAKE_FILE_NAME} \
132 $$CHART_BUILD_PUBLIC_HEADER_DIR
134 $$CHART_BUILD_PUBLIC_HEADER_DIR
133 install_build_public_headers.CONFIG += target_predeps \
135 install_build_public_headers.CONFIG += target_predeps \
134 no_link
136 no_link
135
137
136 install_build_private_headers.name = buld_private_headers
138 install_build_private_headers.name = buld_private_headers
137 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
139 install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h
138 install_build_private_headers.input = PRIVATE_HEADERS
140 install_build_private_headers.input = PRIVATE_HEADERS
139 install_build_private_headers.commands = $$QMAKE_COPY \
141 install_build_private_headers.commands = $$QMAKE_COPY \
140 ${QMAKE_FILE_NAME} \
142 ${QMAKE_FILE_NAME} \
141 $$CHART_BUILD_PRIVATE_HEADER_DIR
143 $$CHART_BUILD_PRIVATE_HEADER_DIR
142 install_build_private_headers.CONFIG += target_predeps \
144 install_build_private_headers.CONFIG += target_predeps \
143 no_link
145 no_link
144
146
145 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
147 QMAKE_EXTRA_COMPILERS += install_build_public_headers \
146 install_build_private_headers \
148 install_build_private_headers \
147
149
148 win32:{
150 win32:{
149 bintarget.CONFIG += no_check_exist
151 bintarget.CONFIG += no_check_exist
150 !staticlib: {
152 !staticlib: {
151 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
153 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.dll
152 }
154 }
153 win32-msvc*:CONFIG(debug, debug|release): {
155 win32-msvc*:CONFIG(debug, debug|release): {
154 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
156 bintarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.pdb
155 }
157 }
156 bintarget.path = $$[QT_INSTALL_BINS]
158 bintarget.path = $$[QT_INSTALL_BINS]
157
159
158 libtarget.CONFIG += no_check_exist
160 libtarget.CONFIG += no_check_exist
159 libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl
161 libtarget.files = $$CHART_BUILD_LIB_DIR\\$${TARGET}.prl
160 win32-msvc*: {
162 win32-msvc*: {
161 libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib
163 libtarget.files += $$CHART_BUILD_LIB_DIR\\$${TARGET}.lib
162 } else {
164 } else {
163 libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a
165 libtarget.files += $$CHART_BUILD_LIB_DIR\\lib$${TARGET}.a
164 }
166 }
165 libtarget.path = $$[QT_INSTALL_LIBS]
167 libtarget.path = $$[QT_INSTALL_LIBS]
166
168
167 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
169 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
168 INSTALLS += bintarget libtarget
170 INSTALLS += bintarget libtarget
169 }else{
171 }else{
170 target.path=$$[QT_INSTALL_LIBS]
172 target.path=$$[QT_INSTALL_LIBS]
171 INSTALLS += target
173 INSTALLS += target
172 }
174 }
173
175
174 mac: !staticlib: {
176 mac: !staticlib: {
175 # Update the name (id) of the library on OSX to point to the lib path
177 # Update the name (id) of the library on OSX to point to the lib path
176 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
178 MAC_CHARTS_LIB_NAME = "lib"$$LIBRARY_NAME".1.dylib"
177 QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME"
179 QMAKE_POST_LINK += "install_name_tool -id $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME $$CHART_BUILD_LIB_DIR"/"$$MAC_CHARTS_LIB_NAME"
178
180
179 # Update the name (id) of the installed library on OSX to point to the installation path
181 # Update the name (id) of the installed library on OSX to point to the installation path
180 postinstall.path = $$[QT_INSTALL_LIBS]
182 postinstall.path = $$[QT_INSTALL_LIBS]
181 postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME"
183 postinstall.extra = "install_name_tool -id $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME $$[QT_INSTALL_LIBS]"/"$$MAC_CHARTS_LIB_NAME"
182 INSTALLS += postinstall
184 INSTALLS += postinstall
183 }
185 }
184
186
185 ################################ DEVELOPMENT BUILD ##########################################
187 ################################ DEVELOPMENT BUILD ##########################################
186 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
188 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
187 # This is the case at least with shadow builds.
189 # This is the case at least with shadow builds.
188 # http://qt-project.org/wiki/jom
190 # http://qt-project.org/wiki/jom
189
191
190 development_build:!win32-msvc*:{
192 development_build:!win32-msvc*:{
191 chartversion.target = $$PWD/qchartversion_p.h
193 chartversion.target = $$PWD/qchartversion_p.h
192
194
193 unix:{
195 unix:{
194 chartversion.commands = @echo \
196 chartversion.commands = @echo \
195 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
197 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
196 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
198 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
197 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
199 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
198 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
200 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
199 $${LITERAL_HASH}endif \" \
201 $${LITERAL_HASH}endif \" \
200 > \
202 > \
201 $$chartversion.target;
203 $$chartversion.target;
202 }else{
204 }else{
203 chartversion.commands = @echo \
205 chartversion.commands = @echo \
204 "const char *buildTime = \"%date%_%time%\" ; \
206 "const char *buildTime = \"%date%_%time%\" ; \
205 const char *gitHead = \"unknown\" ; " \
207 const char *gitHead = \"unknown\" ; " \
206 > \
208 > \
207 $$chartversion.target
209 $$chartversion.target
208 }
210 }
209
211
210 chartversion.depends = $$HEADERS \
212 chartversion.depends = $$HEADERS \
211 $$SOURCES
213 $$SOURCES
212
214
213 PRE_TARGETDEPS += $$chartversion.target
215 PRE_TARGETDEPS += $$chartversion.target
214 QMAKE_CLEAN += $$PWD/qchartversion_p.h
216 QMAKE_CLEAN += $$PWD/qchartversion_p.h
215 QMAKE_EXTRA_TARGETS += chartversion
217 QMAKE_EXTRA_TARGETS += chartversion
216 }
218 }
217
219
218 ############################### CLEAN ###########################################
220 ############################### CLEAN ###########################################
219
221
220 unix:QMAKE_DISTCLEAN += -r \
222 unix:QMAKE_DISTCLEAN += -r \
221 $$CHART_BUILD_HEADER_DIR \
223 $$CHART_BUILD_HEADER_DIR \
222 $$CHART_BUILD_LIB_DIR
224 $$CHART_BUILD_LIB_DIR
223 win32:QMAKE_DISTCLEAN += /Q \
225 win32:QMAKE_DISTCLEAN += /Q \
224 $$CHART_BUILD_HEADER_DIR \
226 $$CHART_BUILD_HEADER_DIR \
225 $$CHART_BUILD_LIB_DIR
227 $$CHART_BUILD_LIB_DIR
226
228
227 ############################## COVERAGE #########################################
229 ############################## COVERAGE #########################################
228
230
229 unix:coverage:{
231 unix:coverage:{
230
232
231 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
233 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
232 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
234 QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
233
235
234 LIBS += -lgcov
236 LIBS += -lgcov
235
237
236 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
238 QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info
237 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
239 QMAKE_EXTRA_TARGETS += preparecoverage gencoverage
238
240
239 preparecoverage.target = prepare_coverage
241 preparecoverage.target = prepare_coverage
240 preparecoverage.depends = all
242 preparecoverage.depends = all
241 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
243 preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\
242 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
244 lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD;
243
245
244 gencoverage.target = gen_coverage
246 gencoverage.target = gen_coverage
245 gencoverage.depends = all
247 gencoverage.depends = all
246 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
248 gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\
247 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;\
249 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;\
248 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;\
250 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;\
249 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
251 lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info;
250 }
252 }
251
253
General Comments 0
You need to be logged in to leave comments. Login now