From 84ef5fc480e3db37b1cd3eac257d56e2c2ff7912 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Mon, 22 Sep 2014 16:38:14 +0800 Subject: [PATCH] copy to qt dir only for make install. some paths fix --- deploy.pri | 17 ++++++------ examples/QMLPlayer/QMLPlayer.pro | 2 +- examples/common/common.pro | 15 ++--------- qml/libQmlAV.pro | 29 ++++++++++++--------- src/libQtAV.pro | 24 ++++++----------- tools/install_sdk/install_sdk.pro | 24 ++++++++++------- tools/install_sdk/{qt4av.prf => qt4/av.prf} | 0 7 files changed, 51 insertions(+), 60 deletions(-) rename tools/install_sdk/{qt4av.prf => qt4/av.prf} (100%) diff --git a/deploy.pri b/deploy.pri index 72b9b0c7e..2ae1dbf76 100644 --- a/deploy.pri +++ b/deploy.pri @@ -1,7 +1,5 @@ isEmpty(PROJECTROOT): PROJECTROOT = $$PWD INSTALL_PREFIX = /usr/local -INSTALL_FOLDER = lib -isEqual(TEMPLATE, app): INSTALL_FOLDER = bin share.files = $$PROJECTROOT/qtc_packaging/common/changelog \ $$PROJECTROOT/qtc_packaging/common/copyright \ @@ -34,23 +32,26 @@ isEqual(TEMPLATE, app) { } INSTALLS += desktopfile icon #debian.path = /DEBIAN - } + target.path = $${INSTALL_PREFIX}/bin + } } else { unix:!symbian { sdkheaders.files = $$SDK_HEADERS + sdkheaders_private.files = $$SDK_PRIVATE_HEADERS isEmpty(SDK_HEADERS) { sdkheaders.files = $$HEADERS } - sdkheaders.path = /usr/local/include/$$SDK_INCLUDE_FOLDER - INSTALLS += sdkheaders + sdkheaders.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME + sdkheaders_private.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$MODULE_VERSION/$$MODULE_INCNAME/private + !plugin: target.path = $$[QT_INSTALL_LIBS] + INSTALLS += sdkheaders sdkheaders_private } } -target.path = $${INSTALL_PREFIX}/$${INSTALL_FOLDER} -INSTALLS += target share +INSTALLS *= target share for(bin, BIN_INSTALLS) { - eval($${bin}.path = $${INSTALL_PREFIX}/$${INSTALL_FOLDER}) + eval($${bin}.path = $${INSTALL_PREFIX}/bin) message("adding $$bin to bin install targets...") INSTALLS += $$bin } diff --git a/examples/QMLPlayer/QMLPlayer.pro b/examples/QMLPlayer/QMLPlayer.pro index c6a594d65..1ed8b8584 100644 --- a/examples/QMLPlayer/QMLPlayer.pro +++ b/examples/QMLPlayer/QMLPlayer.pro @@ -19,7 +19,7 @@ RESOURCES += \ SOURCES += main.cpp # Installation path -# target.path = +target.path = $$[QT_INSTALL_BINS] # Please do not modify the following two lines. Required for deployment. include(qtquick2applicationviewer/qtquick2applicationviewer.pri) diff --git a/examples/common/common.pro b/examples/common/common.pro index 7df9ad885..b6b2eaf18 100644 --- a/examples/common/common.pro +++ b/examples/common/common.pro @@ -22,19 +22,6 @@ PROJECTROOT = $$PWD/../.. !include(libcommon.pri): error("could not find libcommon.pri") preparePaths($$OUT_PWD/../../out) -!ios: copy_sdk_libs = $$DESTDIR/$$qtSharedLib($$NAME) -#plugin.depends = #makefile target -#windows: copy /y file1+file2+... dir. need '+' -for(f, copy_sdk_libs) { - win32: copy_sdk_libs_cmd += $$quote(-\$\(COPY_FILE\) \"$$system_path($$f)\" \"$$system_path($$[QT_INSTALL_BINS])\") - else: copy_sdk_libs_cmd += $$quote(-\$\(COPY_FILE\) \"$$system_path($$f)\" \"$$system_path($$[QT_INSTALL_LIBS])\") -} -#join values seperated by space. so quote is needed -copy_sdk_libs_cmd = $$join(copy_sdk_libs_cmd,$$escape_expand(\\n\\t)) -#just append as a string to $$QMAKE_POST_LINK -isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK = $$copy_sdk_libs_cmd -else: QMAKE_POST_LINK = $${QMAKE_POST_LINK}$$escape_expand(\\n\\t)$$copy_sdk_libs_cmd - RESOURCES += \ theme/theme.qrc @@ -52,3 +39,5 @@ macx:!ios { OBJECTIVE_SOURCES += ScreenSaver.cpp LIBS += -framework CoreServices #-framework ScreenSaver } + +include($$PROJECTROOT/deploy.pri) diff --git a/qml/libQmlAV.pro b/qml/libQmlAV.pro index 83a7418dc..a308a975e 100644 --- a/qml/libQmlAV.pro +++ b/qml/libQmlAV.pro @@ -15,24 +15,25 @@ preparePaths($$OUT_PWD/../out) RESOURCES += QML_FILES = $$PWD/Video.qml -# TODO: why add more files e.g. qmldir cause make error? + +qtav_qml.files = $$PWD/qmldir $$PWD/Video.qml $$PWD/plugins.qmltypes !ios: plugin.files = $$DESTDIR/$$qtSharedLib($$NAME) plugin.path = $$BUILD_DIR/bin/QtAV/ #TODO: Qt install dir #plugin.depends = #makefile target #windows: copy /y file1+file2+... dir. need '+' for(f, plugin.files) { - plugin.commands = $$quote(-\$\(COPY_FILE\) $$shell_path($$f) $$shell_path($$plugin.path)) - plugin.commands += $$escape_expand(\\n\\t)$$quote(-\$\(MKDIR\) $$shell_path($$[QT_INSTALL_QML]/QtAV)) - plugin.commands += $$escape_expand(\\n\\t)$$quote(-\$\(COPY_FILE\) $$shell_path($$f) $$shell_path($$[QT_INSTALL_QML]/QtAV)) + plugin.commands += $$escape_expand(\\n\\t)$$quote(-\$\(MKDIR\) $$shell_path($$plugin.path)) + plugin.commands += $$escape_expand(\\n\\t)$$quote(-\$\(COPY_FILE\) $$shell_path($$f) $$shell_path($$plugin.path)) } #join values seperated by space. so quote is needed #plugin.commands = $$join(plugin.commands,$$escape_expand(\\n\\t)) -OTHER_FILES += qmldir Video.qml plugins.qmltypes +OTHER_FILES += $$qtav_qml.files #just append as a string to $$QMAKE_POST_LINK isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK = $$plugin.commands else: QMAKE_POST_LINK = $${QMAKE_POST_LINK}$$escape_expand(\\n\\t)$$plugin.commands -QMAKE_EXTRA_TARGETS = plugin +#QMAKE_EXTRA_TARGETS = plugin + #POST_TARGETDEPS = plugin #vs, xcode does not support #mkpath($$plugin.path) #no write permision. do it in makefile @@ -43,18 +44,16 @@ QMAKE_EXTRA_TARGETS = plugin #custom compiler: auto update if source is newer extra_copy.output = $$shell_path($$plugin.path)${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} # QMAKE_COPY_FILE, QMAKE_MKDIR_CMD ? -extra_copy.commands = -\$\(MKDIR\) $$shell_path($$plugin.path) -extra_copy.commands += $$escape_expand(\\n\\t)-\$\(COPY_FILE\) ${QMAKE_FILE_NAME} $$shell_path($$plugin.path) -extra_copy.commands += $$escape_expand(\\n\\t)-\$\(MKDIR\) $$shell_path($$[QT_INSTALL_QML]/QtAV) -extra_copy.commands += $$escape_expand(\\n\\t)-\$\(COPY_FILE\) ${QMAKE_FILE_NAME} $$shell_path($$[QT_INSTALL_QML]/QtAV) +extra_copy.commands = -\$\(MKDIR\) $$shell_path($$BUILD_DIR/bin/QtAV/) +extra_copy.commands += $$escape_expand(\\n\\t)-\$\(COPY_FILE\) ${QMAKE_FILE_NAME} $$shell_path($$BUILD_DIR/bin/QtAV/) #extra_copy.depends = $$EXTRA_COPY_FILES #.input is already the depends extra_copy.input = EXTRA_COPY_FILES extra_copy.CONFIG += no_link extra_copy.variable_out = POST_TARGETDEPS -QMAKE_EXTRA_COMPILERS += extra_copy +QMAKE_EXTRA_COMPILERS += extra_copy # # CAN NOT put $$TARGET here otherwise may result in circular dependency. # update EXTRA_COPY_FILES will result in target relink -EXTRA_COPY_FILES = qmldir Video.qml plugins.qmltypes +EXTRA_COPY_FILES = $$qtav_qml.files QMAKE_WRITE_DEFAULT_RC = 1 QMAKE_TARGET_COMPANY = "Shanghai University->S3 Graphics | wbsecg1@gmail.com" @@ -91,5 +90,9 @@ SDK_HEADERS += \ HEADERS *= \ $$SDK_HEADERS -SDK_INCLUDE_FOLDER = QmlAV +target.path = $$[QT_INSTALL_QML]/QtAV +qtav_qml.path = $$[QT_INSTALL_QML]/QtAV +INSTALLS += target qtav_qml + +MODULE = QmlAV include($$PROJECTROOT/deploy.pri) diff --git a/src/libQtAV.pro b/src/libQtAV.pro index 1ba92bbc2..67e59d846 100644 --- a/src/libQtAV.pro +++ b/src/libQtAV.pro @@ -45,19 +45,6 @@ RESOURCES += QtAV.qrc \ } QMAKE_EXTRA_TARGETS += rc } -# copy runtime libs to qt sdk -!mac_framework: copy_sdk_libs = $$DESTDIR/$$qtSharedLib($$NAME) -#plugin.depends = #makefile target -#windows: copy /y file1+file2+... dir. need '+' -for(f, copy_sdk_libs) { - win32: copy_sdk_libs_cmd += $$quote(-\$\(COPY_FILE\) \"$$system_path($$f)\" \"$$system_path($$[QT_INSTALL_BINS])\") - else: copy_sdk_libs_cmd += $$quote(-\$\(COPY_FILE\) \"$$system_path($$f)\" \"$$system_path($$[QT_INSTALL_LIBS])\") -} -#join values seperated by space. so quote is needed -copy_sdk_libs_cmd = $$join(copy_sdk_libs_cmd,$$escape_expand(\\n\\t)) -#just append as a string to $$QMAKE_POST_LINK -isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK = $$copy_sdk_libs_cmd -else: QMAKE_POST_LINK = $${QMAKE_POST_LINK}$$escape_expand(\\n\\t)$$copy_sdk_libs_cmd OTHER_FILES += $$RC_FILE QtAV.svg TRANSLATIONS = i18n/QtAV_zh_CN.ts @@ -353,6 +340,7 @@ SDK_HEADERS *= \ QtAV/AVClock.h \ QtAV/VideoDecoder.h \ QtAV/VideoDecoderTypes.h \ + QtAV/VideoDecoderFFmpegHW.h \ QtAV/VideoFormat.h \ QtAV/VideoFrame.h \ QtAV/FactoryDefine.h \ @@ -399,8 +387,7 @@ HEADERS *= \ QtAV/AVThread.h \ QtAV/AudioThread.h \ QtAV/VideoThread.h \ - QtAV/ColorTransform.h \ - QtAV/VideoDecoderFFmpegHW.h + QtAV/ColorTransform.h # from mkspecs/features/qt_module.prf @@ -427,5 +414,10 @@ mac { } } -SDK_INCLUDE_FOLDER = QtAV +MODULE_INCNAME = QtAV +MODULE_VERSION = $$VERSION +#use Qt version. limited by qmake +# windows: Qt5AV.dll, not Qt1AV.dll +!mac_framework: MODULE_VERSION = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} include($$PROJECTROOT/deploy.pri) + diff --git a/tools/install_sdk/install_sdk.pro b/tools/install_sdk/install_sdk.pro index 93b5043e8..20346abb9 100644 --- a/tools/install_sdk/install_sdk.pro +++ b/tools/install_sdk/install_sdk.pro @@ -42,9 +42,11 @@ win32 { ORIG_LIB = $${LIBPREFIX}$$qtLibName(QtAV, 1).$${LIBSUFFIX} greaterThan(QT_MAJOR_VERSION, 4) { + MODULE_PRF_FILE = $$OUT_PWD/mkspecs/features/av.prf NEW_LIB = $${LIBPREFIX}Qt$${QT_MAJOR_VERSION}AV.$${LIBSUFFIX} MKSPECS_DIR = $$[QT_INSTALL_BINS]/../mkspecs } else { + MODULE_PRF_FILE = $$PWD/qt4/av.prf NEW_LIB = $${ORIG_LIB} MKSPECS_DIR=$$[QMAKE_MKSPECS] } @@ -62,14 +64,11 @@ mac_framework { sdk_install.commands += $$quote($$COPY $$system_path($$PROJECT_LIBDIR/$$ORIG_LIB) $$system_path($$[QT_INSTALL_LIBS]/$$NEW_LIB)) } sdk_install.commands += $$quote($$COPY_DIR $$system_path($$PROJECTROOT/qml/QmlAV) $$system_path($$[QT_INSTALL_HEADERS]/QmlAV)) -greaterThan(QT_MAJOR_VERSION, 4) { - sdk_install.commands += $$quote($$COPY_DIR $$system_path($$BUILD_DIR/bin/QtAV) $$system_path($$[QT_INSTALL_QML]/QtAV)) - sdk_install.commands += $$quote($$COPY $$system_path($$OUT_PWD/mkspecs/features/av.prf) $$system_path($$MKSPECS_DIR/features/)) - sdk_install.commands += $$quote($$COPY $$system_path($$OUT_PWD/mkspecs/modules/qt_lib_av*.pri) $$system_path($$MKSPECS_DIR/modules/)) - sdk_install.commands += $$quote($$COPY $$system_path($$PROJECTROOT/qml/plugins.qmltypes) $$system_path($$[QT_INSTALL_QML]/QtAV/)) -} else { - sdk_install.commands += $$quote($$COPY $$system_path($$PWD/qt4av.prf) $$system_path($$MKSPECS_DIR/features/av.prf)) -} +sdk_install.commands += $$quote($$COPY_DIR $$system_path($$BUILD_DIR/bin/QtAV) $$system_path($$[QT_INSTALL_QML]/QtAV)) +sdk_install.commands += $$quote($$COPY $$system_path($$MODULE_PRF_FILE) $$system_path($$MKSPECS_DIR/features/av.prf)) +sdk_install.commands += $$quote($$COPY $$system_path($$OUT_PWD/mkspecs/modules/qt_lib_av*.pri) $$system_path($$MKSPECS_DIR/modules/)) +sdk_install.commands += $$quote($$COPY $$system_path($$PROJECTROOT/qml/plugins.qmltypes) $$system_path($$[QT_INSTALL_QML]/QtAV/)) + win32: sdk_install.commands += $$quote($$MOVE $$system_path($$[QT_INSTALL_LIBS]/QtAV*.dll) $$system_path($$[QT_INSTALL_BINS]/)) ## copy libcommon.so requred by QMLPlayer and player android: sdk_install.commands += $$quote($$COPY $$system_path($$PROJECT_LIBDIR/libcommon.so) $$system_path($$[QT_INSTALL_LIBS]/)) @@ -105,7 +104,7 @@ AV_PRF_CONT = "android: QMAKE_LFLAGS += -lOpenSLES" #config_avresample: AV_PRF_CONT += "QMAKE_LFLAGS += -lavresample" #config_swresample: AV_PRF_CONT += "QMAKE_LFLAGS += -lswresample" AV_PRF_CONT += "!contains(QT, av): QT *= av" -write_file($$OUT_PWD/mkspecs/features/av.prf, AV_PRF_CONT) +write_file($$MODULE_PRF_FILE, AV_PRF_CONT) MODULE_QMAKE_OUTDIR = $$OUT_PWD @@ -284,3 +283,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri # Schedule the regular .pri file for installation CONFIG += qt_install_module } + +qtav_pri.files = $$MODULE_PRI_FILES +qtav_pri.path = $$MKSPECS_DIR/modules +greaterThan(QT_MAJOR_VERSION, 4): INSTALLS += qtav_pri +qtav_prf.files = $$MODULE_PRF_FILE +qtav_prf.path = $$MKSPECS_DIR/features +INSTALLS += qtav_prf diff --git a/tools/install_sdk/qt4av.prf b/tools/install_sdk/qt4/av.prf similarity index 100% rename from tools/install_sdk/qt4av.prf rename to tools/install_sdk/qt4/av.prf