##// END OF EJS Templates
Some more qmake magic
Michal Klocek -
r1046:7a7ac548bf6d
parent child
Show More
@@ -1,195 +1,197
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 142
143 143 win32:{
144 bintarget.CONFIG +=no_check_exist
144 145 bintarget.files = $$CHART_BUILD_LIB_DIR\\*.dll $$CHART_BUILD_LIB_DIR\\*.pdb
145 146 bintarget.path = $$[QT_INSTALL_BINS]
147 libtarget.CONFIG +=no_check_exist
146 148 libtarget.files = $$CHART_BUILD_LIB_DIR\\*.a $$CHART_BUILD_LIB_DIR\\*.prl $$CHART_BUILD_LIB_DIR\\*.lib
147 149 libtarget.path = $$[QT_INSTALL_LIBS]
148 150 DLLDESTDIR = $$CHART_BUILD_BIN_DIR
149 151 INSTALLS += bintarget libtarget
150 152 }else{
151 153 target.path=$$[QT_INSTALL_LIBS]
152 154 INSTALLS += target
153 155 }
154 156 ################################ DEVELOPMENT BUILD ##########################################
155 157 # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly.
156 158 # This is the case at least with shadow builds.
157 159 # http://qt-project.org/wiki/jom
158 160
159 161 development_build:!win32-msvc*:{
160 162 chartversion.target = $$PWD/qchartversion_p.h
161 163
162 164 unix:{
163 165 chartversion.commands = @echo \
164 166 \" $${LITERAL_HASH}ifndef QCHARTVERSION_P_H\\n\
165 167 $${LITERAL_HASH}define QCHARTVERSION_P_H\\n\
166 168 const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" ; \\n\
167 169 const char *gitHead = \\\"`git rev-parse HEAD`\\\" ; \\n \
168 170 $${LITERAL_HASH}endif \" \
169 171 > \
170 172 $$chartversion.target;
171 173 }else{
172 174 chartversion.commands = @echo \
173 175 "const char *buildTime = \"%date%_%time%\" ; \
174 176 const char *gitHead = \"unknown\" ; " \
175 177 > \
176 178 $$chartversion.target
177 179 }
178 180
179 181 chartversion.depends = $$HEADERS \
180 182 $$SOURCES
181 183
182 184 PRE_TARGETDEPS += $$chartversion.target
183 185 QMAKE_CLEAN += $$PWD/qchartversion_p.h
184 186 QMAKE_EXTRA_TARGETS += chartversion
185 187 }
186 188
187 189 ############################### CLEAN ###########################################
188 190
189 191 unix:QMAKE_DISTCLEAN += -r \
190 192 $$CHART_BUILD_HEADER_DIR \
191 193 $$CHART_BUILD_LIB_DIR
192 194 win32:QMAKE_DISTCLEAN += /Q \
193 195 $$CHART_BUILD_HEADER_DIR \
194 196 $$CHART_BUILD_LIB_DIR
195 197
General Comments 0
You need to be logged in to leave comments. Login now