summaryrefslogtreecommitdiffstats
path: root/examples/examples.pri
blob: f1cf3b3b726b584182e6ad9ed8da47c896aa8346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
android {
    target.path = /libs/$$ANDROID_TARGET_ARCH
} else {
    target.path = $$[QT_INSTALL_EXAMPLES]/datavis3d/$$TARGET
}

win32 {
    CONFIG(debug, release|debug):DESTDIR = $$OUT_PWD/debug
    CONFIG(release, release|debug):DESTDIR = $$OUT_PWD/release
} else {
    DESTDIR = $$OUT_PWD
}

LIBS += -L$$OUT_PWD/../../lib

TEMPLATE = app

QT += datavis3d

contains(TARGET, qml.*) {
    uri = com.digia.QtDataVis3D
    lib_name = datavis3dqml2

    uri_replaced = $$replace(uri, \\., $$QMAKE_DIR_SEP)
    make_qmldir_path = $$DESTDIR/$$uri_replaced
    !exists($$make_qmldir_path) {
        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

    win32 {
        CONFIG(debug, release|debug) {
            src_dir = debug
            src_lib = $${lib_name}d.dll
        }
        CONFIG(release, release|debug){
            src_dir = release
            src_lib = $${lib_name}.dll
        }
    } else {
        src_dir = .
        mac {
            CONFIG(debug, release|debug) {
                src_lib = lib$${lib_name}_debug.dylib
            }
            CONFIG(release, release|debug){
                src_lib = lib$${lib_name}.dylib
            }
        } else {
            # linux, android
            src_lib = lib$${lib_name}.so
        }
    }
    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)\"
    QMAKE_EXTRA_TARGETS += copy_lib
    PRE_TARGETDEPS += $$copy_lib.target

    android {
        android_qmldir.files = $$copy_qmldir_examples.target
        android_qmldir.path = /assets/qml/$$uri_replaced
        android_qmlplugin.files = $$copy_lib.target
        android_qmlplugin.path = $$target.path
        INSTALLS += android_qmldir android_qmlplugin
    }
}