| 1 |
if (NOT USE_QT5) |
| 2 |
qt4_automoc(slowmenu.cpp) |
| 3 |
endif() |
| 4 |
add_executable(slowmenu slowmenu.cpp) |
| 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() |
| 55 |
|
| 56 |
# Macros to create "check" target |
| 57 |
set(_test_executable_list "") |
| 58 |
|
| 59 |
macro(add_test_executable _executable) |
| 60 |
add_test(${_executable} ${_executable}) |
| 61 |
set(_test_executable_list "${_test_executable_list};${_executable}") |
| 62 |
add_executable(${_executable} ${ARGN}) |
| 63 |
endmacro(add_test_executable) |
| 64 |
|
| 65 |
# Call this at the end |
| 66 |
macro(create_check_target) |
| 67 |
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose |
| 68 |
DEPENDS ${_test_executable_list}) |
| 69 |
endmacro(create_check_target) |
| 70 |
|
| 71 |
enable_testing() |
| 72 |
|
| 73 |
|
| 74 |
# dbusmenuexportertest |
| 75 |
set(dbusmenuexportertest_SRCS |
| 76 |
dbusmenuexportertest.cpp |
| 77 |
testutils.cpp |
| 78 |
) |
| 79 |
|
| 80 |
if (NOT USE_QT5) |
| 81 |
qt4_automoc(${dbusmenuexportertest_SRCS}) |
| 82 |
endif() |
| 83 |
|
| 84 |
add_test_executable(dbusmenuexportertest ${dbusmenuexportertest_SRCS}) |
| 85 |
|
| 86 |
target_link_libraries(dbusmenuexportertest |
| 87 |
${test_LIBRARIES} |
| 88 |
) |
| 89 |
|
| 90 |
|
| 91 |
# dbusmenuimportertest |
| 92 |
set(dbusmenuimportertest_SRCS |
| 93 |
dbusmenuimportertest.cpp |
| 94 |
testutils.cpp |
| 95 |
) |
| 96 |
|
| 97 |
if (NOT USE_QT5) |
| 98 |
qt4_automoc(${dbusmenuimportertest_SRCS}) |
| 99 |
endif() |
| 100 |
|
| 101 |
add_test_executable(dbusmenuimportertest ${dbusmenuimportertest_SRCS}) |
| 102 |
|
| 103 |
target_link_libraries(dbusmenuimportertest |
| 104 |
${test_LIBRARIES} |
| 105 |
) |
| 106 |
|
| 107 |
|
| 108 |
# dbusmenushortcuttest |
| 109 |
set(dbusmenushortcuttest_SRCS |
| 110 |
dbusmenushortcuttest.cpp |
| 111 |
) |
| 112 |
|
| 113 |
if (NOT USE_QT5) |
| 114 |
qt4_automoc(${dbusmenushortcuttest_SRCS}) |
| 115 |
endif() |
| 116 |
|
| 117 |
add_test_executable(dbusmenushortcuttest ${dbusmenushortcuttest_SRCS}) |
| 118 |
|
| 119 |
target_link_libraries(dbusmenushortcuttest |
| 120 |
${test_LIBRARIES} |
| 121 |
) |
| 122 |
|
| 123 |
# Keep this at the end |
| 124 |
create_check_target() |