aboutsummaryrefslogtreecommitdiff
path: root/src/backend-dbus
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-03-23 10:04:13 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-03-23 10:04:13 -0500
commitca4b40ade7f432d98c21ac499a0de63244b1c3cc (patch)
tree8d76a7642ab1158f5a35230a1b1f7e3a08e59e8e /src/backend-dbus
parentd782f784d486fd726a870fb9c03e49bd6ef6877c (diff)
downloadayatana-indicator-session-ca4b40ade7f432d98c21ac499a0de63244b1c3cc.tar.gz
ayatana-indicator-session-ca4b40ade7f432d98c21ac499a0de63244b1c3cc.tar.bz2
ayatana-indicator-session-ca4b40ade7f432d98c21ac499a0de63244b1c3cc.zip
use pete woods' hud cmake code for the build.sh script to check for Ninja and to move the gdbus-codegen macros into a resuable file in the cmake/ directory.
Diffstat (limited to 'src/backend-dbus')
-rw-r--r--src/backend-dbus/CMakeLists.txt115
1 files changed, 44 insertions, 71 deletions
diff --git a/src/backend-dbus/CMakeLists.txt b/src/backend-dbus/CMakeLists.txt
index a477cfe..dd928cc 100644
--- a/src/backend-dbus/CMakeLists.txt
+++ b/src/backend-dbus/CMakeLists.txt
@@ -1,86 +1,59 @@
-# autogenerate source code files for our DBus proxies
-function(gdbus_codegen XML_FILE INTERFACE_PREFIX SOURCE_PREFIX)
+set(BACKEND_GENERATED_SOURCES
+)
- set (SRC_C, ${SOURCE_PREFIX}.c)
- set (SRC_H, ${SOURCE_PREFIX}.h)
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-display-manager
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/display-manager.xml)
- # check for the app
- find_program (GDBUS_CODEGEN_EXECUTABLE NAMES gdbus-codegen DOC "gdbus-codegen executable")
- if(NOT GDBUS_CODEGEN_EXECUTABLE)
- message(FATAL_ERROR "Executable gdbus-codegen not found")
- endif()
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-webcredentials
+ com.canonical.indicators
+ ${CMAKE_CURRENT_SOURCE_DIR}/com.canonical.indicators.webcredentials.xml)
- # generate the code
- add_custom_command (
- OUTPUT ${SOURCE_PREFIX}.c ${SOURCE_PREFIX}.h
- COMMAND gdbus-codegen ARGS --interface-prefix ${INTERFACE_PREFIX} --generate-c-code ${SOURCE_PREFIX} ${CMAKE_CURRENT_SOURCE_DIR}/${XML_FILE}
- DEPENDS ${XML_FILE})
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-accounts
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.Accounts.xml)
+
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-user
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.Accounts.User.xml)
- # update our variables
- set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${SRC_C})
- set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${SRC_H})
- set_property (SOURCE ${SRC_C} ${SRC_H} PROPERTY GENERATED)
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-consolekit-manager
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.ConsoleKit.Manager.xml)
- # cleanup
- unset (SRC_C)
- unset (SRC_H)
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-consolekit-seat
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.ConsoleKit.Seat.xml)
-endfunction(gdbus_codegen)
-gdbus_codegen ("display-manager.xml" "org.freedesktop" "dbus-display-manager")
-gdbus_codegen ("com.canonical.indicators.webcredentials.xml" "com.canonical.indicators" "dbus-webcredentials")
-gdbus_codegen ("org.freedesktop.Accounts.xml" "org.freedesktop" "dbus-accounts")
-gdbus_codegen ("org.freedesktop.Accounts.User.xml" "org.freedesktop" "dbus-user")
-gdbus_codegen ("org.freedesktop.ConsoleKit.Manager.xml" "org.freedesktop" "dbus-consolekit-manager")
-gdbus_codegen ("org.freedesktop.ConsoleKit.Seat.xml" "org.freedesktop" "dbus-consolekit-seat")
-gdbus_codegen ("org.freedesktop.ConsoleKit.Session.xml" "org.freedesktop" "dbus-consolekit-session")
-gdbus_codegen ("org.gnome.ScreenSaver.xml" "org" "gnome-screen-saver")
-gdbus_codegen ("org.gnome.SessionManager.xml" "org" "gnome-session-manager")
-gdbus_codegen ("org.gnome.SessionManager.EndSessionDialog.xml" "org.gnome.SessionManager" "dbus-end-session-dialog")
-gdbus_codegen ("upower.xml" "org.freedesktop" "dbus-upower")
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-consolekit-session
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.ConsoleKit.Session.xml)
+
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES gnome-screen-saver
+ org
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.gnome.ScreenSaver.xml)
+
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES gnome-session-manager
+ org
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.gnome.SessionManager.xml)
+
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-end-session-dialog
+ org.gnome.SessionManager
+ ${CMAKE_CURRENT_SOURCE_DIR}/org.gnome.SessionManager.EndSessionDialog.xml)
+
+add_gdbus_codegen (BACKEND_GENERATED_SOURCES dbus-upower
+ org.freedesktop
+ ${CMAKE_CURRENT_SOURCE_DIR}/upower.xml)
+
+set (SOURCES actions.c backend-dbus.c guest.c users.c utils.c)
# add warnings/coverage info on handwritten files
# but not the autogenerated ones...
-set_source_files_properties (actions.c
- backend-dbus.c
- guest.c
- users.c
- utils.c
+set_source_files_properties (${SOURCES}
PROPERTIES COMPILE_FLAGS " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}")
# add the bin dir to our include path s.t. our code can find the autogenerated header files
include_directories (${CMAKE_CURRENT_BINARY_DIR} ${SERVICE_INCLUDE_DIRS})
-add_library (backenddbus STATIC
- gnome-screen-saver.c
- gnome-screen-saver.h
- gnome-session-manager.c
- gnome-session-manager.h
- dbus-display-manager.c
- dbus-display-manager.h
- dbus-consolekit-manager.c
- dbus-consolekit-manager.h
- dbus-consolekit-seat.c
- dbus-consolekit-seat.h
- dbus-consolekit-session.c
- dbus-consolekit-session.h
- dbus-accounts.c
- dbus-accounts.h
- dbus-upower.c
- dbus-upower.h
- dbus-user.c
- dbus-user.h
- dbus-webcredentials.c
- dbus-webcredentials.h
- dbus-end-session-dialog.c
- dbus-end-session-dialog.h
- actions.c
- actions.h
- backend-dbus.c
- backend-dbus.h
- guest.c
- guest.h
- users.c
- users.h
- utils.c
- utils.h)
+add_library (backenddbus STATIC ${SOURCES} ${BACKEND_GENERATED_SOURCES})