qskinny/examples/automotive/automotive.pro

121 lines
3.1 KiB
Prolog
Raw Normal View History

2019-04-02 09:07:09 +02:00
CONFIG += qskexample
2017-07-25 07:24:27 +02:00
HEADERS += \
ButtonBar.h \
2017-07-25 07:24:27 +02:00
SoundControl.h \
2017-07-25 21:34:27 +02:00
SkinFactory.h \
2017-07-25 07:24:27 +02:00
DefaultSkin.h \
OtherSkin.h \
MainWindow.h \
Speedometer.h \
SpeedometerSkinlet.h \
SpeedometerDisplay.h
2017-07-25 07:24:27 +02:00
SOURCES += \
ButtonBar.cpp \
2017-07-25 07:24:27 +02:00
SoundControl.cpp \
2017-07-25 21:34:27 +02:00
SkinFactory.cpp \
2017-07-25 07:24:27 +02:00
DefaultSkin.cpp \
OtherSkin.cpp \
MainWindow.cpp \
main.cpp \
Speedometer.cpp \
SpeedometerSkinlet.cpp \
SpeedometerDisplay.cpp
2017-07-25 21:34:27 +02:00
QRCFILES += \
images.qrc
IMGSOURCES = \
images/background.jpg
2017-07-25 21:34:27 +02:00
SVGSOURCES = \
images/car.svg \
2017-07-25 21:34:27 +02:00
images/left.svg \
images/down.svg \
images/right.svg \
images/up.svg \
2017-07-25 21:34:27 +02:00
images/bluetooth.svg \
images/bookmark.svg \
images/bus.svg \
images/cloud.svg \
images/compass.svg \
images/location.svg \
images/man.svg \
images/menu.svg \
images/phone.svg \
images/plane.svg \
images/train.svg \
images/user.svg
2017-07-25 21:34:27 +02:00
###########
# The rcc file includes the precompiled SVGs and so we need to build
# rules for running svg2qvg, when a SVG has changed into the Makefile
# before running rccgen.
# While this would be an easy one in Makefile syntax it is a nightmare
# with qmake.
# TODO: we should at least offer some sort of *.pri file to help with
# writing application project files.
###########
SVG2QVG=$${QSK_OUT_ROOT}/tools/bin/svg2qvg
svg2qvg.name = SVG compiler
svg2qvg.input = SVGSOURCES
svg2qvg.output = qvg/${QMAKE_FILE_BASE}.qvg
svg2qvg.variable_out =
svg2qvg.commands += mkdir -p qvg && $${SVG2QVG} ${QMAKE_FILE_IN} $${svg2qvg.output}
imgcpy.name = Image copy
imgcpy.input = IMGSOURCES
imgcpy.output = images/${QMAKE_FILE_BASE}.jpg
imgcpy.variable_out =
imgcpy.commands += mkdir -p images && $${QMAKE_COPY} ${QMAKE_FILE_IN} $${imgcpy.output}
2017-07-25 21:34:27 +02:00
rccgen.name = RCC compiler
rccgen.input = QRCFILES
rccgen.output = $${RCC_DIR}/qrc_${QMAKE_FILE_BASE}.cpp
rccgen.variable_out = SOURCES
rccgen.commands += $${QMAKE_MKDIR} $${RCC_DIR}
!equals( OUT_PWD, $${PWD} ) {
# Paths inside a qrc file are always relative to the path of the
# qrc file itself. So in case of shadow builds we need to copy the
# qrc file into the shadow directory as the included qvg files
# are generated locally.
QRC_SHADOW_CLONE = $${OUT_PWD}/${QMAKE_FILE_BASE}_shadow.qrc
rccgen.commands += && $${QMAKE_COPY} ${QMAKE_FILE_IN} $${QRC_SHADOW_CLONE}
rccgen.commands += && $$dirname(QMAKE_QMAKE)/rcc $${QRC_SHADOW_CLONE} -o ${QMAKE_FILE_OUT}
2017-07-25 21:34:27 +02:00
rccgen.commands += && $${QMAKE_DEL_FILE} $${QRC_SHADOW_CLONE}
rccgen.depends += $${IMGSOURCES}
QMAKE_EXTRA_COMPILERS += imgcpy
2017-07-25 21:34:27 +02:00
}
else {
rccgen.commands += && $$dirname(QMAKE_QMAKE)/rcc ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
2017-07-25 21:34:27 +02:00
}
# We would like to define a dependency for "svg2qvg.variable_out" -
# but how to do this ? As long as we don't have a solution we have to use
# the workaround below.
defineReplace(qvgfiles) {
svgfiles = $$1
myfiles=
for(svgfile, svgfiles) myfiles += $$replace(svgfile, svg, qvg)
myfiles2=
for(myfile, myfiles) myfiles2 += $$replace(myfile, images, qvg)
return($$myfiles2)
}
2017-07-25 21:34:27 +02:00
rccgen.depends += $$qvgfiles( $${SVGSOURCES} )
QMAKE_EXTRA_COMPILERS += svg2qvg rccgen