Skip to content

Commit

Permalink
define qtav version in project file only once. copy mkspecs for ifw
Browse files Browse the repository at this point in the history
qt5 can use .qmake.conf in project root to store default configurations.
qt4 use .qmake.cache instead
  • Loading branch information
wang-bin committed Dec 27, 2014
1 parent 9141bef commit 2c5f3f6
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
QTAV_MAJOR_VERSION = 1
QTAV_MINOR_VERSION = 4
QTAV_PATCH_VERSION = 2

QTAV_VERSION = $${QTAV_MAJOR_VERSION}.$${QTAV_MINOR_VERSION}.$${QTAV_PATCH_VERSION}
#MODULE_VERSION = $$QTAV_VERSION
6 changes: 3 additions & 3 deletions QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS = examples
examples.depends = libqtav
}
!no-tests {
!android:!no-tests {
SUBDIRS = tests
tests.depends = libqtav
}
Expand Down Expand Up @@ -60,8 60,8 @@ runConfigTests()
}


PACKAGE_VERSION = 1.4.1
PACKAGE_VERSION = $$QTAV_VERSION
PACKAGE_NAME= QtAV

include(pack.pri)
#packageSet(1.4.1, QtAV)
#packageSet($$QTAV_VERSION, QtAV)
2 changes: 1 addition & 1 deletion examples/QMLPlayer/QMLPlayer.pro
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
VERSION = 1.4.2
VERSION = $$QTAV_VERSION
*maemo*: DEFINES = Q_OS_MAEMO
# Add more folders to ship with the application, here
folder_01.source = qml/QMLPlayer
Expand Down
2 changes: 1 addition & 1 deletion examples/common/libcommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 48,7 @@ NAME = common
}
eval(LIB$$upper($$NAME)_PRI_INCLUDED = 1)

LIB_VERSION = 1.4.1 #0.x.y may be wrong for dll
LIB_VERSION = $$QTAV_VERSION #0.x.y may be wrong for dll
ios: STATICLINK=1
isEmpty(STATICLINK): STATICLINK = 0 #1 or 0. use static lib or not

Expand Down
4 changes: 2 additions & 2 deletions qml/libQmlAV.pri
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 48,7 @@ NAME = QmlAV
}
eval(LIB$$upper($$NAME)_PRI_INCLUDED = 1)

LIB_VERSION = 1.4.1 #0.x.y may be wrong for dll
LIB_VERSION = $$QTAV_VERSION #0.x.y may be wrong for dll
ios: STATICLINK=1
isEmpty(STATICLINK): STATICLINK = 0 #1 or 0. use static lib or not

Expand Down Expand Up @@ -138,7 138,7 @@ unix {
# TODO: for macx. see qtcreator/src/rpath.pri. (-rpath define rpath, @rpath exapand to that path?)
macx|ios {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/Frameworks/
QMAKE_LFLAGS = -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../
#QMAKE_LFLAGS = -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../
} else {
RPATHDIR = \$\$ORIGIN \$\$ORIGIN/lib . /usr/local/lib
# $$PROJECT_LIBDIR only for host == target. But QMAKE_TARGET.arch is only available on windows. QT_ARCH is bad, e.g. QT_ARCH=i386 while QMAKE_HOST.arch=i686
Expand Down
14 changes: 10 additions & 4 deletions qtc_packaging/ifw/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 15,11 @@ MKSPEC=`grep mkspecs_cached $BUILD/.qmake.cache |cut -d "=" -f 2`
MKSPEC=`echo $MKSPEC`

TARGET=${MKSPEC}-${ARCH}
QTAV_VER=`grep PACKAGE_VERSION ../../QtAV.pro |cut -d "=" -f 2`
QTAV_VER=`echo $QTAV_VER`
QTAV_VER_MAJOR=`grep -m 1 QTAV_MAJOR_VERSION ../../.qmake.conf |cut -d "=" -f 2 | tr -d ' '`
QTAV_VER_MINOR=`grep -m 1 QTAV_MINOR_VERSION ../../.qmake.conf |cut -d "=" -f 2 | tr -d ' '`
QTAV_VER_PATCH=`grep -m 1 QTAV_PATCH_VERSION ../../.qmake.conf |cut -d "=" -f 2 | tr -d ' '`
QTAV_VER=${QTAV_VER_MAJOR}.${QTAV_VER_MINOR}.${QTAV_VER_PATCH}
echo "QtAV $QTAV_VER"

function platform_is() {
local name=$1
Expand Down Expand Up @@ -94,12 97,15 @@ cp -Lf $LIBQTAV $TARGET/packages/com.qtav.product.runtime/data/bin
echo "coping development files..."
cp -af ../../src/QtAV $TARGET/packages/com.qtav.product.dev/data/include
cp -af ../../qml/QmlAV $TARGET/packages/com.qtav.product.dev/data/include
cp -af $BUILD/tools/install_sdk/mkspecs $TARGET/packages/com.qtav.product.dev/data
cp -af ../../{README.md,lgpl-2.1.txt,gpl-3.0.txt,doc} $TARGET/packages/com.qtav.product/data

#mingw: libQt5AV1.a
cp -af $LIBDIR/*Qt*AV* $TARGET/packages/com.qtav.product.dev/data/lib


[ -f $LIBDIR/Qt5AV1.lib ] && cp -af $LIBDIR/libQt5AV1.a $TARGET/packages/com.qtav.product.dev/data/lib/Qt5AV.lib
[ -f $LIBDIR/libQt5AV1.a ] && cp -af $LIBDIR/libQt5AV1.a $TARGET/packages/com.qtav.product.dev/data/lib/libQt5AV.a
[ -f $LIBDIR/libQt5AV1.so ] && cp -af $LIBDIR/libQt5AV1.a $TARGET/packages/com.qtav.product.dev/data/lib/libQt5AV.so
rm -f $TARGET/packages/com.qtav.product.dev/data/lib/{*.dll,*.so.*}

# player
echo "coping player files..."
Expand Down
11 changes: 11 additions & 0 deletions root.pri
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 49,17 @@ defineTest(qtRunCommandQuitly) {
return(true)
}

isEmpty(QTAV_VERSION) {
QTAV_MAJOR_VERSION = 1
QTAV_MINOR_VERSION = 4
QTAV_PATCH_VERSION = 2
QTAV_VERSION = $${QTAV_MAJOR_VERSION}.$${QTAV_MINOR_VERSION}.$${QTAV_PATCH_VERSION}
message("QTAV_VERSION not set, cache the default $$QTAV_VERSION")
cache(QTAV_MAJOR_VERSION, set, QTAV_MAJOR_VERSION)
cache(QTAV_MINOR_VERSION, set, QTAV_MINOR_VERSION)
cache(QTAV_PATCH_VERSION, set, QTAV_PATCH_VERSION)
cache(QTAV_VERSION, set, QTAV_VERSION)
}
defineTest(testArch) {
test_dir = $$_PRO_FILE_PWD_/tests/arch
test_out_dir = $$shadowed($$test_dir)
Expand Down
3 changes: 2 additions & 1 deletion src/libQtAV.pri
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 48,7 @@ NAME = QtAV
}
eval(LIB$$upper($$NAME)_PRI_INCLUDED = 1)

LIB_VERSION = 1.4.1 #0.x.y may be wrong for dll
LIB_VERSION = $$QTAV_VERSION #0.x.y may be wrong for dll
ios: STATICLINK=1
isEmpty(STATICLINK): STATICLINK = 0 #1 or 0. use static lib or not

Expand Down Expand Up @@ -141,6 141,7 @@ unix {
# TODO: for macx. see qtcreator/src/rpath.pri. (-rpath define rpath, @rpath exapand to that path?)
macx|ios {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,$$PROJECT_LIBDIR/
# 5.4
#QMAKE_LFLAGS = -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../
} else {
RPATHDIR = \$\$ORIGIN \$\$ORIGIN/lib . /usr/local/lib $$[QT_INSTALL_LIBS]
Expand Down
2 changes: 1 addition & 1 deletion tools/install_sdk/install_sdk.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ PROJECTROOT = $$PWD/../..
include($$PROJECTROOT/common.pri)
preparePaths($$OUT_PWD/../../out)

VERSION = 1.4.1
VERSION = $$QTAV_VERSION
# windows: Qt5AV.dll, not Qt1AV.dll
!mac_framework: VERSION = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}

Expand Down

0 comments on commit 2c5f3f6

Please sign in to comment.