aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore3
-rw-r--r--CMakeLists.txt5
-rw-r--r--libqmenumodel/QMenuModel/CMakeLists.txt21
-rw-r--r--libqmenumodel/src/CMakeLists.txt27
-rw-r--r--tests/client/CMakeLists.txt32
-rw-r--r--tests/script/CMakeLists.txt30
6 files changed, 16 insertions, 102 deletions
diff --git a/.bzrignore b/.bzrignore
index fe5eb7b..13a6812 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -6,7 +6,8 @@ Testing/
cmake_install.cmake
install_manifest.txt
-moc_*.cxx
+moc_*.cpp
+*_automoc.cpp
coverage/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bffb4e..f51f637 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,11 +2,12 @@ project(qmenumodel)
cmake_minimum_required(VERSION 2.8.9)
-find_package(Qt5Core)
-
+find_package(Qt5Core REQUIRED)
include(FindPkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_NO_KEYWORDS)
find_program(DBUS_RUNNER dbus-test-runner)
diff --git a/libqmenumodel/QMenuModel/CMakeLists.txt b/libqmenumodel/QMenuModel/CMakeLists.txt
index fbc448e..8a7702f 100644
--- a/libqmenumodel/QMenuModel/CMakeLists.txt
+++ b/libqmenumodel/QMenuModel/CMakeLists.txt
@@ -4,40 +4,23 @@ set(QMLPLUGIN_SRC
plugin.cpp
)
-set(QMLPLUGIN_HEADERS
- plugin.h
-)
-
-qt5_wrap_cpp(QMLPLUGIN_MOC
- ${QMLPLUGIN_HEADERS}
-)
-
add_library(qmenumodel-qml MODULE
${QMLPLUGIN_SRC}
- ${QMLPLUGIN_MOC}
)
include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
${src_SOURCE_DIR}
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTDECLARATIVE_INCLUDE_DIR}
${GLIB_INCLUDE_DIRS}
- ${GIO_INCLUDE_DIRS}
)
-qt5_use_modules(qmenumodel-qml Qml Widgets)
-
target_link_libraries(qmenumodel-qml
qmenumodel
- ${QT_QTCORE_LIBRARY}
- ${QT_QTDCLARATIVE_LIBRARY}
${GLIB_LDFLAGS}
${GIO_LDFLAGS}
)
+qt5_use_modules(qmenumodel-qml Qml Widgets)
+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
"${CMAKE_CURRENT_BINARY_DIR}/qmldir")
diff --git a/libqmenumodel/src/CMakeLists.txt b/libqmenumodel/src/CMakeLists.txt
index 7e31941..373d11b 100644
--- a/libqmenumodel/src/CMakeLists.txt
+++ b/libqmenumodel/src/CMakeLists.txt
@@ -2,6 +2,7 @@ project(src)
set(QMENUMODEL_SRC
converter.cpp
+ dbus-enums.h
qmenumodel.cpp
qdbusobject.cpp
qdbusmenumodel.cpp
@@ -9,41 +10,15 @@ set(QMENUMODEL_SRC
qstateaction.cpp
)
-set(QMENUMODEL_HEADERS
- converter.h
- dbus-enums.h
- qmenumodel.h
- qdbusobject.h
- qdbusmenumodel.h
- qdbusactiongroup.h
- qstateaction.h
-)
-
-qt5_wrap_cpp(QMENUMODEL_MOC
- ${QMENUMODEL_HEADERS}
-)
-
add_library(qmenumodel STATIC
${QMENUMODEL_SRC}
- ${QMENUMODEL_MOC}
)
set_target_properties(qmenumodel PROPERTIES COMPILE_FLAGS -fPIC)
include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
${GLIB_INCLUDE_DIRS}
- ${GIO_INCLUDE_DIRS}
)
qt5_use_modules(qmenumodel Core Widgets)
-target_link_libraries(qmenumodel
- ${QT_QTCORE_LIBRARY}
- ${GLIB_LDFLAGS}
- ${GIO_LDFLAGS}
-)
-
diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt
index e9de735..7455b16 100644
--- a/tests/client/CMakeLists.txt
+++ b/tests/client/CMakeLists.txt
@@ -1,18 +1,12 @@
macro(declare_test testname)
- set(TEST_MOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${testname}.moc)
- qt5_generate_moc(${testname}.cpp ${TEST_MOC_FILE})
-
- add_executable(${testname} ${testname}.cpp ${TEST_MOC_FILE})
+ add_executable(${testname} ${testname}.cpp)
qt5_use_modules(${testname} Core DBus Widgets Test)
target_link_libraries(${testname}
qmenumodel
dbusmenuscript
- ${QT_QTTEST_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTDBUS_LIBRARY}
${GLIB_LDFLAGS}
- ${GIO_LDFLAGS})
+ ${GIO_LDFLAGS}
+ )
add_test(${testname}
${DBUS_RUNNER}
@@ -26,19 +20,13 @@ macro(declare_test testname)
endmacro(declare_test testname)
macro(declare_simple_test testname)
- set(TEST_MOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${testname}.moc)
- qt5_generate_moc(${testname}.cpp ${TEST_MOC_FILE})
-
- add_executable(${testname} ${testname}.cpp ${TEST_MOC_FILE})
+ add_executable(${testname} ${testname}.cpp)
qt5_use_modules(${testname} Core Test)
target_link_libraries(${testname}
qmenumodel
- ${QT_QTTEST_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTDBUS_LIBRARY}
${GLIB_LDFLAGS}
- ${GIO_LDFLAGS})
+ ${GIO_LDFLAGS}
+ )
add_test(${testname}
${CMAKE_CURRENT_BINARY_DIR}/${testname})
@@ -49,14 +37,8 @@ endmacro(declare_simple_test testname)
include_directories(${src_SOURCE_DIR}
${dbusmenuscript_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${QT_INCLUDE_DIR}
- ${QT_QTTEST_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTDBUS_INCLUDE_DIR}
${GLIB_INCLUDE_DIRS}
- ${GIO_INCLUDE_DIRS})
+)
add_definitions(-DTEST_SUITE)
set(TEST_PYTHONPATH ${dbusmenuscript_SOURCE_DIR})
diff --git a/tests/script/CMakeLists.txt b/tests/script/CMakeLists.txt
index bf415f5..afa073b 100644
--- a/tests/script/CMakeLists.txt
+++ b/tests/script/CMakeLists.txt
@@ -1,36 +1,8 @@
project(dbusmenuscript)
-set(DBUSMENUSCRIPT_SRC
- dbusmenuscript.cpp
-)
-
-set(DBUSMENUSCRIPT_HEADERS
- dbusmenuscript.h
-)
-
-qt5_wrap_cpp(DBUSMENUSCRIPT_MOC
- ${DBUSMENUSCRIPT_HEADERS}
-)
-
-add_library(dbusmenuscript STATIC
- ${DBUSMENUSCRIPT_SRC}
- ${DBUSMENUSCRIPT_MOC}
-)
+add_library(dbusmenuscript STATIC dbusmenuscript.cpp)
set_target_properties(dbusmenuscript PROPERTIES COMPILE_FLAGS -fPIC)
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_INCLUDE_DIR}
- ${QT_QTTEST_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTDBUS_INCLUDE_DIR}
-)
-
qt5_use_modules(dbusmenuscript Core DBus Test)
-target_link_libraries(dbusmenuscript
- ${QT_QTCORE_LIBRARY}
- ${QT_QTTEST_LIBRARY}
- ${QT_QTDBUS_LIBRARY}
-)