Skip to content

Commit

Permalink
copy to qt dir only for make install. some paths fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Sep 22, 2014
1 parent 94513bd commit 84ef5fc
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 60 deletions.
17 changes: 9 additions & 8 deletions deploy.pri
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion examples/QMLPlayer/QMLPlayer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 2 additions & 13 deletions examples/common/common.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -52,3 +39,5 @@ macx:!ios {
OBJECTIVE_SOURCES += ScreenSaver.cpp
LIBS += -framework CoreServices #-framework ScreenSaver
}

include($$PROJECTROOT/deploy.pri)
29 changes: 16 additions & 13 deletions qml/libQmlAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 | [email protected]"
Expand Down Expand Up @@ -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)
24 changes: 8 additions & 16 deletions src/libQtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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)

24 changes: 15 additions & 9 deletions tools/install_sdk/install_sdk.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand All @@ -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]/))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
File renamed without changes.

0 comments on commit 84ef5fc

Please sign in to comment.