From 99d7cbbb8887382ea17dcbeb90a8d768bb9ebdb5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 10 Jan 2014 15:08:47 +0200 Subject: Improve static build support. Now qml plugin can also be built statically. Change-Id: Id37f565ab9e02529fafaffa024acd69560b3703a Reviewed-by: Mika Salmela --- tests/tests.pri | 65 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 15 deletions(-) (limited to 'tests/tests.pri') diff --git a/tests/tests.pri b/tests/tests.pri index fd17b360..d374ea3b 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -19,6 +19,15 @@ TEMPLATE = app QT += datavisualization +!static:android { + # Add Qt library to be loaded in shared android build + vis_lib_name = DataVisualization + vis_src_lib = lib$${vis_lib_name}.so + vis_lib_dir = $$OUT_PWD/../../lib/$$vis_src_lib + vis_lib_formatted = $$replace(vis_lib_dir, /, $$QMAKE_DIR_SEP) + ANDROID_EXTRA_LIBS = $$vis_lib_formatted +} + contains(TARGET, qml.*) { uri = QtDataVisualization lib_name = datavisualizationqml2 @@ -29,46 +38,72 @@ contains(TARGET, qml.*) { make_qmldir_target = \"$$replace(make_qmldir_path, /, $$QMAKE_DIR_SEP)\" system($$QMAKE_MKDIR $$make_qmldir_target) } - copy_qmldir_examples.target = $$make_qmldir_path/qmldir - copy_qmldir_examples.depends = $$_PRO_FILE_PWD_/../../src/$$lib_name/qmldir - copy_qmldir_examples.commands = $(COPY_FILE) \"$$replace(copy_qmldir_examples.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir_examples.target, /, $$QMAKE_DIR_SEP)\" - QMAKE_EXTRA_TARGETS += copy_qmldir_examples - PRE_TARGETDEPS += $$copy_qmldir_examples.target + copy_qmldir.target = $$make_qmldir_path/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/../../src/$$lib_name/qmldir + copy_qmldir_formatted = \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + copy_qmldir.commands = $(COPY_FILE) $$copy_qmldir_formatted + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target + + static:contains(QT_CONFIG, static) { + # Make import scan find our copied qmldir & statically built qml lib + LIB_EXTENSION = lib + QMLPATHS += $$DESTDIR + # We need to copy the qmldir & lib already at qmake run stage as import scan is done then + exists($$copy_qmldir.depends): system($$QMAKE_COPY $$copy_qmldir_formatted) + } else { + win32 { + LIB_EXTENSION = dll + } else { + mac { + LIB_EXTENSION = dylib + } else { + LIB_EXTENSION = so + } + } + } win32 { CONFIG(debug, release|debug) { src_dir = debug - src_lib = $${lib_name}d.dll + src_lib = $${lib_name}d.$$LIB_EXTENSION } CONFIG(release, release|debug){ src_dir = release - src_lib = $${lib_name}.dll + src_lib = $${lib_name}.$$LIB_EXTENSION } } else { src_dir = . mac { CONFIG(debug, release|debug) { - src_lib = lib$${lib_name}_debug.dylib + src_lib = lib$${lib_name}_debug.$$LIB_EXTENSION } CONFIG(release, release|debug){ - src_lib = lib$${lib_name}.dylib + src_lib = lib$${lib_name}.$$LIB_EXTENSION } } else { # linux, android - src_lib = lib$${lib_name}.so + src_lib = lib$${lib_name}.$$LIB_EXTENSION } } copy_lib.target = $$make_qmldir_path/$$src_lib copy_lib.depends = $$OUT_PWD/../../src/$$lib_name/$$src_dir/$$src_lib - copy_lib.commands = $(COPY_FILE) \"$$replace(copy_lib.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_lib.target, /, $$QMAKE_DIR_SEP)\" + copy_lib_formatted = \"$$replace(copy_lib.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_lib.target, /, $$QMAKE_DIR_SEP)\" + copy_lib.commands = $(COPY_FILE) $$copy_lib_formatted QMAKE_EXTRA_TARGETS += copy_lib PRE_TARGETDEPS += $$copy_lib.target android { - android_qmldir.files = $$copy_qmldir_examples.target + system($$QMAKE_COPY $$copy_qmldir_formatted) + android_qmldir.files = $$copy_qmldir.target android_qmldir.path = /assets/qml/$$uri_replaced - android_qmlplugin.files = $$copy_lib.target - android_qmlplugin.path = $$target.path - INSTALLS += android_qmldir android_qmlplugin + INSTALLS += android_qmldir + # No need to do custom install for qml plugin lib when it is statically built into app + !static|!contains(QT_CONFIG, static) { + system($$QMAKE_COPY $$copy_lib_formatted) + android_qmlplugin.files = $$copy_lib.target + android_qmlplugin.path = $$target.path + INSTALLS += android_qmlplugin + } } } -- cgit v1.2.3 From 289584f6e4434577abea050855fb59ef84417070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 24 Jan 2014 09:55:54 +0200 Subject: iOS fix for qml examples Change-Id: Ia8e70005c467746bccc9cc6023b2cb485d5a8e7e Reviewed-by: Miikka Heikkinen --- tests/tests.pri | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'tests/tests.pri') diff --git a/tests/tests.pri b/tests/tests.pri index d374ea3b..13ba2c7a 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -47,7 +47,11 @@ contains(TARGET, qml.*) { static:contains(QT_CONFIG, static) { # Make import scan find our copied qmldir & statically built qml lib - LIB_EXTENSION = lib + !win32 { + LIB_EXTENSION = a + } else { + LIB_EXTENSION = lib + } QMLPATHS += $$DESTDIR # We need to copy the qmldir & lib already at qmake run stage as import scan is done then exists($$copy_qmldir.depends): system($$QMAKE_COPY $$copy_qmldir_formatted) @@ -55,7 +59,7 @@ contains(TARGET, qml.*) { win32 { LIB_EXTENSION = dll } else { - mac { + mac|ios { LIB_EXTENSION = dylib } else { LIB_EXTENSION = so @@ -65,16 +69,16 @@ contains(TARGET, qml.*) { win32 { CONFIG(debug, release|debug) { - src_dir = debug + src_dir = /debug src_lib = $${lib_name}d.$$LIB_EXTENSION } CONFIG(release, release|debug){ - src_dir = release + src_dir = /release src_lib = $${lib_name}.$$LIB_EXTENSION } } else { - src_dir = . - mac { + src_dir = + mac|ios { CONFIG(debug, release|debug) { src_lib = lib$${lib_name}_debug.$$LIB_EXTENSION } @@ -87,7 +91,7 @@ contains(TARGET, qml.*) { } } copy_lib.target = $$make_qmldir_path/$$src_lib - copy_lib.depends = $$OUT_PWD/../../src/$$lib_name/$$src_dir/$$src_lib + copy_lib.depends = $$OUT_PWD/../../src/$$lib_name$$src_dir/$$src_lib copy_lib_formatted = \"$$replace(copy_lib.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_lib.target, /, $$QMAKE_DIR_SEP)\" copy_lib.commands = $(COPY_FILE) $$copy_lib_formatted QMAKE_EXTRA_TARGETS += copy_lib @@ -98,12 +102,17 @@ contains(TARGET, qml.*) { android_qmldir.files = $$copy_qmldir.target android_qmldir.path = /assets/qml/$$uri_replaced INSTALLS += android_qmldir - # No need to do custom install for qml plugin lib when it is statically built into app - !static|!contains(QT_CONFIG, static) { - system($$QMAKE_COPY $$copy_lib_formatted) - android_qmlplugin.files = $$copy_lib.target - android_qmlplugin.path = $$target.path - INSTALLS += android_qmlplugin - } + } + ios { + system($$QMAKE_COPY $$copy_qmldir_formatted) + ios_qmldir.files = $$copy_qmldir.target + ios_qmldir.path = /TODO/$$uri_replaced + INSTALLS += ios_qmldir + } + android|ios { + system($$QMAKE_COPY $$copy_lib_formatted) + android_qmlplugin.files = $$copy_lib.target + android_qmlplugin.path = $$target.path + INSTALLS += android_qmlplugin } } -- cgit v1.2.3 From 8178f10769f7f7d84d4d1180994d0232e5fc8f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Mon, 27 Jan 2014 07:31:49 +0200 Subject: iOS changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed unnecessary lines from examples and tests project includes Task-number: QTRD-2802 Change-Id: Ie4f546f432babce0c3a96abf5b35012f730102a2 Reviewed-by: Tomi Korpipää --- tests/tests.pri | 6 ------ 1 file changed, 6 deletions(-) (limited to 'tests/tests.pri') diff --git a/tests/tests.pri b/tests/tests.pri index 13ba2c7a..59253152 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -103,12 +103,6 @@ contains(TARGET, qml.*) { android_qmldir.path = /assets/qml/$$uri_replaced INSTALLS += android_qmldir } - ios { - system($$QMAKE_COPY $$copy_qmldir_formatted) - ios_qmldir.files = $$copy_qmldir.target - ios_qmldir.path = /TODO/$$uri_replaced - INSTALLS += ios_qmldir - } android|ios { system($$QMAKE_COPY $$copy_lib_formatted) android_qmlplugin.files = $$copy_lib.target -- cgit v1.2.3