~dbusmenu-team/libdbusmenu-qt/trunk

« back to all changes in this revision

Viewing changes to tests/CMakeLists.txt

  • Committer: CI Train Bot
  • Author(s): Nick Dedekind
  • Date: 2016-02-18 10:13:59 UTC
  • mfrom: (267.2.3 libdbusmenu-qt-tests)
  • Revision ID: ci-train-bot@canonical.com-20160218101359-qxwy2g2ip63egzra
Ported tests to Qt5.
Approved by: PS Jenkins bot, David Edmundson

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
qt4_automoc(slowmenu.cpp)
 
1
if (NOT USE_QT5)
 
2
    qt4_automoc(slowmenu.cpp)
 
3
endif()
2
4
add_executable(slowmenu slowmenu.cpp)
3
 
target_link_libraries(
4
 
    slowmenu
5
 
    ${QT_QTGUI_LIBRARY}
6
 
    ${QT_QTCORE_LIBRARY}
7
 
    ${QT_QTDBUS_LIBRARY}
8
 
    dbusmenu-qt
9
 
    )
 
5
 
 
6
if (NOT USE_QT5)
 
7
    target_link_libraries(slowmenu
 
8
        ${QT_QTGUI_LIBRARIES}
 
9
        ${QT_QTDBUS_LIBRARIES}
 
10
        ${QT_QTCORE_LIBRARIES}
 
11
        dbusmenu-qt
 
12
    )
 
13
 
 
14
    set(test_LIBRARIES
 
15
        ${QT_QTGUI_LIBRARY}
 
16
        ${QT_QTCORE_LIBRARY}
 
17
        ${QT_QTDBUS_LIBRARY}
 
18
        ${QT_QTTEST_LIBRARY}
 
19
        dbusmenu-qt
 
20
    )
 
21
 
 
22
    include_directories(
 
23
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
 
24
        ${CMAKE_CURRENT_BINARY_DIR}/../src
 
25
        ${CMAKE_CURRENT_BINARY_DIR}
 
26
        ${QT_QTTEST_INCLUDE_DIR}
 
27
        ${QT_QTDBUS_INCLUDE_DIR}
 
28
        )
 
29
else()
 
30
    find_package(Qt5Test REQUIRED)
 
31
 
 
32
    target_link_libraries(slowmenu
 
33
        ${Qt5Gui_LIBRARIES}
 
34
        ${Qt5Core_LIBRARIES}
 
35
        ${Qt5DBus_LIBRARIES}
 
36
        dbusmenu-qt5
 
37
    )
 
38
 
 
39
    set(test_LIBRARIES
 
40
        ${Qt5Gui_LIBRARIES}
 
41
        ${Qt5Core_LIBRARIES}
 
42
        ${Qt5DBus_LIBRARIES}
 
43
        ${Qt5Test_LIBRARIES}
 
44
        dbusmenu-qt5
 
45
    )
 
46
 
 
47
    include_directories(
 
48
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
 
49
        ${CMAKE_CURRENT_BINARY_DIR}/../src
 
50
        ${CMAKE_CURRENT_BINARY_DIR}
 
51
        ${Qt5Test_INCLUDE_DIRS}
 
52
        ${Qt5DBus_INCLUDE_DIRS}
 
53
        )
 
54
endif()
10
55
 
11
56
# Macros to create "check" target
12
57
set(_test_executable_list "")
23
68
        DEPENDS ${_test_executable_list})
24
69
endmacro(create_check_target)
25
70
 
26
 
include_directories(
27
 
    ${CMAKE_CURRENT_SOURCE_DIR}/../src
28
 
    ${CMAKE_CURRENT_BINARY_DIR}/../src
29
 
    ${CMAKE_CURRENT_BINARY_DIR}
30
 
    ${QT_QTTEST_INCLUDE_DIR}
31
 
    ${QT_QTDBUS_INCLUDE_DIR}
32
 
    )
33
 
 
34
 
set(test_LIBRARIES
35
 
    ${QT_QTGUI_LIBRARY}
36
 
    ${QT_QTCORE_LIBRARY}
37
 
    ${QT_QTDBUS_LIBRARY}
38
 
    ${QT_QTTEST_LIBRARY}
39
 
    dbusmenu-qt
40
 
    )
41
 
 
42
71
enable_testing()
43
72
 
 
73
 
44
74
# dbusmenuexportertest
45
75
set(dbusmenuexportertest_SRCS
46
76
    dbusmenuexportertest.cpp
47
77
    testutils.cpp
48
78
    )
49
79
 
50
 
qt4_automoc(${dbusmenuexportertest_SRCS})
 
80
if (NOT USE_QT5)
 
81
    qt4_automoc(${dbusmenuexportertest_SRCS})
 
82
endif()
51
83
 
52
84
add_test_executable(dbusmenuexportertest ${dbusmenuexportertest_SRCS})
53
85
 
55
87
    ${test_LIBRARIES}
56
88
    )
57
89
 
 
90
 
58
91
# dbusmenuimportertest
59
92
set(dbusmenuimportertest_SRCS
60
93
    dbusmenuimportertest.cpp
61
94
    testutils.cpp
62
95
    )
63
96
 
64
 
qt4_automoc(${dbusmenuimportertest_SRCS})
 
97
if (NOT USE_QT5)
 
98
    qt4_automoc(${dbusmenuimportertest_SRCS})
 
99
endif()
65
100
 
66
101
add_test_executable(dbusmenuimportertest ${dbusmenuimportertest_SRCS})
67
102
 
69
104
    ${test_LIBRARIES}
70
105
    )
71
106
 
 
107
 
72
108
# dbusmenushortcuttest
73
109
set(dbusmenushortcuttest_SRCS
74
110
    dbusmenushortcuttest.cpp
75
111
    )
76
112
 
77
 
qt4_automoc(${dbusmenushortcuttest_SRCS})
 
113
if (NOT USE_QT5)
 
114
    qt4_automoc(${dbusmenushortcuttest_SRCS})
 
115
endif()
78
116
 
79
117
add_test_executable(dbusmenushortcuttest ${dbusmenushortcuttest_SRCS})
80
118