aboutsummaryrefslogtreecommitdiff
path: root/src/backend-dbus/CMakeLists.txt
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-03-22 16:34:34 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-03-22 16:34:34 -0500
commitae39f7001e5603010afc02de29787ade6d48ef14 (patch)
tree74c303a86603134fc2b86d1c428475a60e455e3f /src/backend-dbus/CMakeLists.txt
parente4e327f139dd139a91893fc7f19061a37d4b47e9 (diff)
downloadayatana-indicator-session-ae39f7001e5603010afc02de29787ade6d48ef14.tar.gz
ayatana-indicator-session-ae39f7001e5603010afc02de29787ade6d48ef14.tar.bz2
ayatana-indicator-session-ae39f7001e5603010afc02de29787ade6d48ef14.zip
port indicator-session to GMenu/cmake. Code coverage increased from 0% to 95.4%.
Diffstat (limited to 'src/backend-dbus/CMakeLists.txt')
-rw-r--r--src/backend-dbus/CMakeLists.txt86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/backend-dbus/CMakeLists.txt b/src/backend-dbus/CMakeLists.txt
new file mode 100644
index 0000000..a477cfe
--- /dev/null
+++ b/src/backend-dbus/CMakeLists.txt
@@ -0,0 +1,86 @@
+# autogenerate source code files for our DBus proxies
+function(gdbus_codegen XML_FILE INTERFACE_PREFIX SOURCE_PREFIX)
+
+ set (SRC_C, ${SOURCE_PREFIX}.c)
+ set (SRC_H, ${SOURCE_PREFIX}.h)
+
+ # 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()
+
+ # 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})
+
+ # 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)
+
+ # cleanup
+ unset (SRC_C)
+ unset (SRC_H)
+
+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 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
+ 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)
+