@@ -1,65 +1,73 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2012 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #ifndef CHARTCONFIG_H_ |
|
22 | 22 | #define CHARTCONFIG_H_ |
|
23 | 23 | |
|
24 | 24 | #include "qchartglobal.h" |
|
25 | #ifdef Q_CC_MSVC | |
|
26 | // There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. | |
|
27 | // This is the case at least with shadow builds. | |
|
28 | // http://qt-project.org/wiki/jom | |
|
29 | const char *buildTime = __DATE__; | |
|
30 | const char *gitHead = "unknown"; | |
|
31 | #else | |
|
25 | 32 | #include "qchartversion_p.h" |
|
33 | #endif | |
|
26 | 34 | |
|
27 | 35 | |
|
28 | 36 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | 37 | |
|
30 | 38 | class ChartConfig { |
|
31 | 39 | |
|
32 | 40 | private: |
|
33 | 41 | ChartConfig(){ |
|
34 | 42 | #ifndef QT_NO_DEBUG |
|
35 | 43 | qDebug()<<"buildTime" << buildTime; |
|
36 | 44 | qDebug()<<"gitHead" << gitHead; |
|
37 | 45 | #endif |
|
38 | 46 | m_instance = this; |
|
39 | 47 | } |
|
40 | 48 | public: |
|
41 | 49 | static ChartConfig* instance(){ |
|
42 | 50 | if(!m_instance){ |
|
43 | 51 | m_instance= new ChartConfig(); |
|
44 | 52 | } |
|
45 | 53 | return m_instance; |
|
46 | 54 | } |
|
47 | 55 | |
|
48 | 56 | QString compilationTime(){ |
|
49 | 57 | return buildTime; |
|
50 | 58 | } |
|
51 | 59 | |
|
52 | 60 | QString compilationHead(){ |
|
53 | 61 | return gitHead; |
|
54 | 62 | } |
|
55 | 63 | |
|
56 | 64 | private: |
|
57 | 65 | static ChartConfig* m_instance; |
|
58 | 66 | }; |
|
59 | 67 | |
|
60 | 68 | |
|
61 | 69 | ChartConfig* ChartConfig::m_instance=0; |
|
62 | 70 | |
|
63 | 71 | #endif |
|
64 | 72 | |
|
65 | 73 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,158 +1,170 | |||
|
1 | 1 | !include( ../common.pri ):error( Couldn't find the common.pri file! ) |
|
2 | 2 | TARGET = QtCommercialChart |
|
3 | 3 | DESTDIR = $$CHART_BUILD_LIB_DIR |
|
4 | 4 | TEMPLATE = lib |
|
5 | 5 | QT += core \ |
|
6 | 6 | gui |
|
7 | 7 | win32-msvc*: LIBS += User32.lib |
|
8 | 8 | CONFIG += debug_and_release |
|
9 | 9 | CONFIG(debug, debug|release):TARGET = QtCommercialChartd |
|
10 | 10 | SOURCES += \ |
|
11 | 11 | $$PWD/chartdataset.cpp \ |
|
12 | 12 | $$PWD/chartpresenter.cpp \ |
|
13 | 13 | $$PWD/charttheme.cpp \ |
|
14 | 14 | $$PWD/domain.cpp \ |
|
15 | 15 | $$PWD/qchart.cpp \ |
|
16 | 16 | $$PWD/qchartview.cpp \ |
|
17 | 17 | $$PWD/qseries.cpp \ |
|
18 | 18 | $$PWD/qlegend.cpp \ |
|
19 | 19 | $$PWD/legendmarker.cpp \ |
|
20 | 20 | $$PWD/legendscrollbutton.cpp \ |
|
21 | 21 | $$PWD/chartbackground.cpp \ |
|
22 | 22 | $$PWD/chart.cpp |
|
23 | 23 | PRIVATE_HEADERS += \ |
|
24 | 24 | $$PWD/chartdataset_p.h \ |
|
25 | 25 | $$PWD/chartitem_p.h \ |
|
26 | 26 | $$PWD/chartpresenter_p.h \ |
|
27 | 27 | $$PWD/charttheme_p.h \ |
|
28 | 28 | $$PWD/domain_p.h \ |
|
29 | 29 | $$PWD/legendmarker_p.h \ |
|
30 | 30 | $$PWD/legendscrollbutton_p.h \ |
|
31 | 31 | $$PWD/chartbackground_p.h \ |
|
32 | 32 | $$PWD/chart_p.h \ |
|
33 | 33 | $$PWD/chartconfig_p.h \ |
|
34 | 34 | $$PWD/qchart_p.h \ |
|
35 | 35 | $$PWD/qchartview_p.h |
|
36 | 36 | PUBLIC_HEADERS += \ |
|
37 | 37 | $$PWD/qchart.h \ |
|
38 | 38 | $$PWD/qchartglobal.h \ |
|
39 | 39 | $$PWD/qseries.h \ |
|
40 | 40 | $$PWD/qchartview.h \ |
|
41 | 41 | $$PWD/qlegend.h |
|
42 | 42 | |
|
43 | 43 | include(animations/animations.pri) |
|
44 | 44 | include(axis/axis.pri) |
|
45 | 45 | include(xychart/xychart.pri) |
|
46 | 46 | include(linechart/linechart.pri) |
|
47 | 47 | include(areachart/areachart.pri) |
|
48 | 48 | include(barchart/barchart.pri) |
|
49 | 49 | include(piechart/piechart.pri) |
|
50 | 50 | include(scatterseries/scatter.pri) |
|
51 | 51 | include(splinechart/splinechart.pri) |
|
52 | 52 | include(themes/themes.pri) |
|
53 | 53 | |
|
54 | 54 | |
|
55 | 55 | HEADERS += $$PUBLIC_HEADERS |
|
56 | 56 | HEADERS += $$PRIVATE_HEADERS |
|
57 | 57 | HEADERS += $$THEMES |
|
58 | 58 | INCLUDEPATH += ../include . |
|
59 | 59 | |
|
60 | 60 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
61 | 61 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
62 | 62 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
63 | 63 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
64 | 64 | DEFINES += QTCOMMERCIALCHART_LIBRARY |
|
65 | 65 | |
|
66 | 66 | #qt public headers |
|
67 | 67 | #this is very primitive and lame parser , TODO: make perl script insted |
|
68 | 68 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) |
|
69 | 69 | { |
|
70 | 70 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) |
|
71 | 71 | win32:{ |
|
72 | 72 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
73 | 73 | }else{ |
|
74 | 74 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
75 | 75 | } |
|
76 | 76 | system($$command) |
|
77 | 77 | } |
|
78 | 78 | |
|
79 | 79 | for(file, PUBLIC_HEADERS) { |
|
80 | 80 | name = $$split(file,'/') |
|
81 | 81 | name = $$last(name) |
|
82 | 82 | class = "$$cat($$file)" |
|
83 | 83 | class = $$find(class,class) |
|
84 | 84 | !isEmpty(class){ |
|
85 | 85 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) |
|
86 | 86 | class = $$member(class,1) |
|
87 | 87 | class = $$split(class,' ') |
|
88 | 88 | class = $$replace(class,' ','') |
|
89 | 89 | class = $$member(class,0) |
|
90 | 90 | win32:{ |
|
91 | 91 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
92 | 92 | }else{ |
|
93 | 93 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
94 | 94 | } |
|
95 | 95 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class |
|
96 | 96 | system($$command) |
|
97 | 97 | } |
|
98 | 98 | } |
|
99 | 99 | |
|
100 | 100 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
101 | 101 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS |
|
102 | 102 | |
|
103 | 103 | target.path = $$[QT_INSTALL_LIBS] |
|
104 | 104 | INSTALLS += target public_headers |
|
105 | 105 | |
|
106 | 106 | install_build_public_headers.name = build_public_headers |
|
107 | 107 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
108 | 108 | install_build_public_headers.input = PUBLIC_HEADERS |
|
109 | 109 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
110 | 110 | ${QMAKE_FILE_NAME} \ |
|
111 | 111 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
112 | 112 | install_build_public_headers.CONFIG += target_predeps \ |
|
113 | 113 | no_link |
|
114 | 114 | |
|
115 | 115 | install_build_private_headers.name = buld_private_headers |
|
116 | 116 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
117 | 117 | install_build_private_headers.input = PRIVATE_HEADERS |
|
118 | 118 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
119 | 119 | ${QMAKE_FILE_NAME} \ |
|
120 | 120 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
121 | 121 | install_build_private_headers.CONFIG += target_predeps \ |
|
122 | 122 | no_link |
|
123 | 123 | |
|
124 | 124 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
125 | 125 | install_build_private_headers \ |
|
126 | 126 | |
|
127 | 127 | |
|
128 | !win32-msvc*: { | |
|
129 | ||
|
130 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. | |
|
131 | # This is the case at least with shadow builds. | |
|
132 | # http://qt-project.org/wiki/jom | |
|
133 | ||
|
128 | 134 | chartversion.target = $$PWD/qchartversion_p.h |
|
135 | ||
|
129 | 136 | unix:{ |
|
130 | 137 | chartversion.commands = @echo \ |
|
131 | 138 | "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \ |
|
132 | 139 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \ |
|
133 | 140 | > \ |
|
134 | 141 | $$chartversion.target; |
|
135 | 142 | }else{ |
|
136 | 143 | chartversion.commands = @echo \ |
|
137 | 144 | "const char *buildTime = \"%date%_%time%\" ; \ |
|
138 | 145 | const char *gitHead = \"unknown\" ; " \ |
|
139 | 146 | > \ |
|
140 | 147 | $$chartversion.target |
|
141 | 148 | } |
|
149 | ||
|
142 | 150 | chartversion.depends = $$HEADERS \ |
|
143 | 151 | $$SOURCES |
|
152 | ||
|
144 | 153 | PRE_TARGETDEPS += $$PWD/qchartversion_p.h |
|
154 | QMAKE_CLEAN += $$PWD/qchartversion_p.h | |
|
145 | 155 | QMAKE_EXTRA_TARGETS += chartversion |
|
156 | } | |
|
157 | ||
|
146 | 158 | unix:QMAKE_DISTCLEAN += -r \ |
|
147 | 159 | $$CHART_BUILD_HEADER_DIR \ |
|
148 | 160 | $$CHART_BUILD_LIB_DIR |
|
149 | 161 | win32:QMAKE_DISTCLEAN += /Q \ |
|
150 | 162 | $$CHART_BUILD_HEADER_DIR \ |
|
151 | 163 | $$CHART_BUILD_LIB_DIR |
|
152 | 164 | |
|
153 | 165 | # treat warnings as errors |
|
154 | 166 | win32-msvc*: { |
|
155 | 167 | QMAKE_CXXFLAGS += /WX |
|
156 | 168 | } else { |
|
157 | 169 | QMAKE_CXXFLAGS += -Werror |
|
158 | 170 | } |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now