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