@@ -1,195 +1,195 | |||
|
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 | ############################# DEPEDENCES ######################################## |
|
19 | 19 | |
|
20 | 20 | win32-msvc*: LIBS += User32.lib |
|
21 | 21 | LIBS -= -l$$LIBRARY_NAME |
|
22 | 22 | INCLUDEPATH += ../include . |
|
23 | 23 | |
|
24 | 24 | ############################# SOURCES ########################################## |
|
25 | 25 | |
|
26 | 26 | SOURCES += \ |
|
27 | 27 | $$PWD/chartdataset.cpp \ |
|
28 | 28 | $$PWD/chartpresenter.cpp \ |
|
29 | 29 | $$PWD/charttheme.cpp \ |
|
30 | 30 | $$PWD/domain.cpp \ |
|
31 | 31 | $$PWD/qchart.cpp \ |
|
32 | 32 | $$PWD/qchartview.cpp \ |
|
33 | 33 | $$PWD/qabstractseries.cpp \ |
|
34 | 34 | $$PWD/chartbackground.cpp \ |
|
35 | 35 | $$PWD/chart.cpp \ |
|
36 | 36 | $$PWD/scroller.cpp |
|
37 | 37 | PRIVATE_HEADERS += \ |
|
38 | 38 | $$PWD/chartdataset_p.h \ |
|
39 | 39 | $$PWD/chartitem_p.h \ |
|
40 | 40 | $$PWD/chartpresenter_p.h \ |
|
41 | 41 | $$PWD/charttheme_p.h \ |
|
42 | 42 | $$PWD/domain_p.h \ |
|
43 | 43 | $$PWD/chartbackground_p.h \ |
|
44 | 44 | $$PWD/chart_p.h \ |
|
45 | 45 | $$PWD/chartconfig_p.h \ |
|
46 | 46 | $$PWD/qchart_p.h \ |
|
47 | 47 | $$PWD/qchartview_p.h \ |
|
48 | 48 | $$PWD/scroller_p.h \ |
|
49 | 49 | $$PWD/qabstractseries_p.h |
|
50 | 50 | PUBLIC_HEADERS += \ |
|
51 | 51 | $$PWD/qchart.h \ |
|
52 | 52 | $$PWD/qchartglobal.h \ |
|
53 | 53 | $$PWD/qabstractseries.h \ |
|
54 | 54 | $$PWD/qchartview.h |
|
55 | 55 | |
|
56 | 56 | include(animations/animations.pri) |
|
57 | 57 | include(areachart/areachart.pri) |
|
58 | 58 | include(axis/axis.pri) |
|
59 | 59 | include(barchart/barchart.pri) |
|
60 | 60 | include(legend/legend.pri) |
|
61 | 61 | include(linechart/linechart.pri) |
|
62 | 62 | include(piechart/piechart.pri) |
|
63 | 63 | include(scatterseries/scatter.pri) |
|
64 | 64 | include(splinechart/splinechart.pri) |
|
65 | 65 | include(themes/themes.pri) |
|
66 | 66 | include(xychart/xychart.pri) |
|
67 | 67 | |
|
68 | 68 | HEADERS += $$PUBLIC_HEADERS |
|
69 | 69 | HEADERS += $$PRIVATE_HEADERS |
|
70 | 70 | HEADERS += $$THEMES |
|
71 | 71 | |
|
72 | 72 | ############################# BUILD PATH ########################################## |
|
73 | 73 | |
|
74 | 74 | OBJECTS_DIR = $$CHART_BUILD_DIR/lib |
|
75 | 75 | MOC_DIR = $$CHART_BUILD_DIR/lib |
|
76 | 76 | UI_DIR = $$CHART_BUILD_DIR/lib |
|
77 | 77 | RCC_DIR = $$CHART_BUILD_DIR/lib |
|
78 | 78 | |
|
79 | 79 | ############################# PUBLIC HEADERS GENERTOR ########################################## |
|
80 | 80 | |
|
81 | 81 | #this is very primitive and lame parser , TODO: make perl script insted |
|
82 | 82 | !exists($$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal) |
|
83 | 83 | { |
|
84 | 84 | system($$QMAKE_MKDIR $$CHART_BUILD_PUBLIC_HEADER_DIR) |
|
85 | 85 | win32:{ |
|
86 | 86 | command = "echo $${LITERAL_HASH}include \"qchartglobal.h\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
87 | 87 | }else{ |
|
88 | 88 | command = "echo \"$${LITERAL_HASH}include \\\"qchartglobal.h\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal" |
|
89 | 89 | } |
|
90 | 90 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/QChartGlobal |
|
91 | 91 | system($$command) |
|
92 | 92 | } |
|
93 | 93 | |
|
94 | 94 | for(file, PUBLIC_HEADERS) { |
|
95 | 95 | name = $$split(file,'/') |
|
96 | 96 | name = $$last(name) |
|
97 | 97 | class = "$$cat($$file)" |
|
98 | 98 | class = $$find(class,class) |
|
99 | 99 | !isEmpty(class){ |
|
100 | 100 | class = $$split(class,QTCOMMERCIALCHART_EXPORT) |
|
101 | 101 | class = $$member(class,1) |
|
102 | 102 | class = $$split(class,' ') |
|
103 | 103 | class = $$replace(class,' ','') |
|
104 | 104 | class = $$member(class,0) |
|
105 | 105 | win32:{ |
|
106 | 106 | command = "echo $${LITERAL_HASH}include \"$$name\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
107 | 107 | }else{ |
|
108 | 108 | command = "echo \"$${LITERAL_HASH}include \\\"$$name\\\"\" > $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class" |
|
109 | 109 | } |
|
110 | 110 | PUBLIC_QT_HEADERS += $$CHART_BUILD_PUBLIC_HEADER_DIR/$$class |
|
111 | 111 | system($$command) |
|
112 | 112 | } |
|
113 | 113 | } |
|
114 | 114 | |
|
115 | 115 | ############################# INSTALLERS ########################################## |
|
116 | 116 | |
|
117 | 117 | public_headers.path = $$[QT_INSTALL_HEADERS]/QtCommercialChart |
|
118 | 118 | public_headers.files = $$PUBLIC_HEADERS $$PUBLIC_QT_HEADERS |
|
119 | 119 | INSTALLS += public_headers |
|
120 | 120 | |
|
121 | 121 | install_build_public_headers.name = build_public_headers |
|
122 | 122 | install_build_public_headers.output = $$CHART_BUILD_PUBLIC_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
123 | 123 | install_build_public_headers.input = PUBLIC_HEADERS |
|
124 | 124 | install_build_public_headers.commands = $$QMAKE_COPY \ |
|
125 | 125 | ${QMAKE_FILE_NAME} \ |
|
126 | 126 | $$CHART_BUILD_PUBLIC_HEADER_DIR |
|
127 | 127 | install_build_public_headers.CONFIG += target_predeps \ |
|
128 | 128 | no_link |
|
129 | 129 | |
|
130 | 130 | install_build_private_headers.name = buld_private_headers |
|
131 | 131 | install_build_private_headers.output = $$CHART_BUILD_PRIVATE_HEADER_DIR/${QMAKE_FILE_BASE}.h |
|
132 | 132 | install_build_private_headers.input = PRIVATE_HEADERS |
|
133 | 133 | install_build_private_headers.commands = $$QMAKE_COPY \ |
|
134 | 134 | ${QMAKE_FILE_NAME} \ |
|
135 | 135 | $$CHART_BUILD_PRIVATE_HEADER_DIR |
|
136 | 136 | install_build_private_headers.CONFIG += target_predeps \ |
|
137 | 137 | no_link |
|
138 | 138 | |
|
139 | 139 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
140 | 140 | install_build_private_headers \ |
|
141 | 141 | |
|
142 | target.path=$$[QT_INSTALL_LIBS] | |
|
143 | INSTALLS += target | |
|
144 | 142 | |
|
145 | 143 | win32:{ |
|
146 | dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS] | |
|
144 | bintarget.files = ..\\lib\\*.dll ..\\lib\\*.pdb | |
|
145 | bintarget.path = $$[QT_INSTALL_BINS] | |
|
146 | libtarget.files = ..\\lib\\*.a ..\\lib\\*.prl ..\\lib\\*.lib | |
|
147 | libtarget.path = $$[QT_INSTALL_LIBS] | |
|
147 | 148 | DLLDESTDIR = $$CHART_BUILD_BIN_DIR |
|
148 | dlltarget.path=$$[QT_INSTALL_BINS] | |
|
149 | target.files = ..\\lib\\*.a ..\\lib\\*.prl | |
|
150 | INSTALLS += dlltarget | |
|
151 | } | |
|
152 | ||
|
153 | ||
|
149 | INSTALLS += bintarget libtarget | |
|
150 | }else{ | |
|
151 | target.path=$$[QT_INSTALL_LIBS] | |
|
152 | INSTALLS += target | |
|
153 | } | |
|
154 | 154 | ################################ DEVELOPMENT BUILD ########################################## |
|
155 | 155 | # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. |
|
156 | 156 | # This is the case at least with shadow builds. |
|
157 | 157 | # http://qt-project.org/wiki/jom |
|
158 | 158 | |
|
159 | 159 | development_build:!win32-msvc*:{ |
|
160 | 160 | chartversion.target = $$PWD/qchartversion_p.h |
|
161 | 161 | |
|
162 | 162 | unix:{ |
|
163 | 163 | chartversion.commands = @echo \ |
|
164 | 164 | \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\ |
|
165 | 165 | $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\ |
|
166 | 166 | const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\ |
|
167 | 167 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \ |
|
168 | 168 | $${LITERAL_HASH}endif \" \ |
|
169 | 169 | > \ |
|
170 | 170 | $$chartversion.target; |
|
171 | 171 | }else{ |
|
172 | 172 | chartversion.commands = @echo \ |
|
173 | 173 | "const char *buildTime = \"%date%_%time%\" ; \ |
|
174 | 174 | const char *gitHead = \"unknown\" ; " \ |
|
175 | 175 | > \ |
|
176 | 176 | $$chartversion.target |
|
177 | 177 | } |
|
178 | 178 | |
|
179 | 179 | chartversion.depends = $$HEADERS \ |
|
180 | 180 | $$SOURCES |
|
181 | 181 | |
|
182 | 182 | PRE_TARGETDEPS += $$chartversion.target |
|
183 | 183 | QMAKE_CLEAN += $$PWD/qchartversion_p.h |
|
184 | 184 | QMAKE_EXTRA_TARGETS += chartversion |
|
185 | 185 | } |
|
186 | 186 | |
|
187 | 187 | ############################### CLEAN ########################################### |
|
188 | 188 | |
|
189 | 189 | unix:QMAKE_DISTCLEAN += -r \ |
|
190 | 190 | $$CHART_BUILD_HEADER_DIR \ |
|
191 | 191 | $$CHART_BUILD_LIB_DIR |
|
192 | 192 | win32:QMAKE_DISTCLEAN += /Q \ |
|
193 | 193 | $$CHART_BUILD_HEADER_DIR \ |
|
194 | 194 | $$CHART_BUILD_LIB_DIR |
|
195 | 195 |
General Comments 0
You need to be logged in to leave comments.
Login now