summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qpluginloader/tst/CMakeLists.txt
blob: ca27cef44ba3dd7690b37e29ea538219d3e6fc5e (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
# Generated from tst.pro.

#####################################################################
## tst_qpluginloader Test:
#####################################################################

# Collect test data
list(APPEND test_data "../elftest")
list(APPEND test_data "../machtest")

qt_internal_add_test(tst_qpluginloader
    OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
    SOURCES
        ../fakeplugin.cpp
        ../theplugin/plugininterface.h
        ../tst_qpluginloader.cpp
    LIBRARIES
        staticplugin
    TESTDATA ${test_data}
)

add_dependencies(tst_qpluginloader tst_qpluginloaderlib staticplugin theplugin)
if (UNIX)
    if(NOT APPLE)
        add_dependencies(tst_qpluginloader theoldplugin)
    endif()
    if (NOT ANDROID AND NOT APPLE)
        add_dependencies(tst_qpluginloader almostplugin)
    endif()
endif()

if(ANDROID)
    add_compile_definitions(ANDROID_ARCH="${CMAKE_ANDROID_ARCH_ABI}")
    set(plugins
        theplugin
        theoldplugin
        tst_qpluginloaderlib
    )
    set(extra_libs)
    foreach(plugin IN LISTS plugins)
        list(APPEND extra_libs
            "${CMAKE_CURRENT_BINARY_DIR}/../bin/lib${plugin}_${CMAKE_ANDROID_ARCH_ABI}.so")
    endforeach()
    set_target_properties(tst_qpluginloader PROPERTIES
        QT_ANDROID_EXTRA_LIBS "${extra_libs}"
    )
endif()

## Scopes:
#####################################################################

qt_internal_extend_target(tst_qpluginloader CONDITION QT_FEATURE_private_tests
    LIBRARIES
        Qt::CorePrivate
)

qt_internal_extend_target(tst_qpluginloader CONDITION CMAKE_BUILD_TYPE STREQUAL Debug AND WIN32 AND debug_and_release
    PUBLIC_LIBRARIES
        # Remove: L../staticplugin/debug
)

qt_internal_extend_target(tst_qpluginloader CONDITION WIN32 AND debug_and_release AND NOT CMAKE_BUILD_TYPE STREQUAL Debug
    PUBLIC_LIBRARIES
        # Remove: L../staticplugin/release
)

qt_internal_extend_target(tst_qpluginloader CONDITION UNIX OR NOT debug_and_release
    PUBLIC_LIBRARIES
        # Remove: L../staticplugin
)