aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPete Woods <pete.woods@canonical.com>2013-08-16 04:13:41 +0100
committerPete Woods <pete.woods@canonical.com>2013-08-16 04:13:41 +0100
commit796a887cf88c1ad23ab06e89435ca1e04080aaee (patch)
treee449f277b6672abd016afd97ff1210e32948b46d /src
parent4fedffcef1054e4093c4528d40cce809f1e958b3 (diff)
downloadayatana-indicator-sound-796a887cf88c1ad23ab06e89435ca1e04080aaee.tar.gz
ayatana-indicator-sound-796a887cf88c1ad23ab06e89435ca1e04080aaee.tar.bz2
ayatana-indicator-sound-796a887cf88c1ad23ab06e89435ca1e04080aaee.zip
Build using cmake
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt128
-rw-r--r--src/Makefile.am37
-rw-r--r--src/service.vala3
-rw-r--r--src/sound-menu.vala3
4 files changed, 131 insertions, 40 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..21931b9
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,128 @@
+
+###########################
+# Vala Generation
+###########################
+
+set(HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.h")
+set(SYMBOLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.def")
+
+vala_init(indicator-sound-service
+ PACKAGES
+ config
+ gio-2.0
+ gio-unix-2.0
+ libxml-2.0
+ libpulse
+ libpulse-mainloop-glib
+ OPTIONS
+ --ccode
+ --thread
+ --vapidir=${CMAKE_SOURCE_DIR}/vapi/
+ --vapidir=.
+ --target-glib=2.36
+)
+
+vala_add(indicator-sound-service
+ service.vala
+ DEPENDS
+ sound-menu
+ volume-control
+ media-player
+ media-player-list
+)
+vala_add(indicator-sound-service
+ main.vala
+ DEPENDS
+ service
+)
+vala_add(indicator-sound-service
+ volume-control.vala
+)
+vala_add(indicator-sound-service
+ media-player.vala
+ DEPENDS
+ mpris2-interfaces
+)
+vala_add(indicator-sound-service
+ media-player-list.vala
+ DEPENDS
+ media-player
+ mpris2-watcher
+)
+vala_add(indicator-sound-service
+ mpris2-interfaces.vala
+)
+vala_add(indicator-sound-service
+ mpris2-watcher.vala
+ DEPENDS
+ media-player
+ mpris2-interfaces
+ freedesktop-interfaces
+)
+vala_add(indicator-sound-service
+ freedesktop-interfaces.vala
+)
+vala_add(indicator-sound-service
+ sound-menu.vala
+ DEPENDS
+ media-player
+)
+
+vala_finish(indicator-sound-service
+ SOURCES
+ project_VALA_SOURCES
+ OUTPUTS
+ project_VALA_C
+ GENERATE_HEADER
+ ${HEADER_PATH}
+ GENERATE_SYMBOLS
+ ${SYMBOLS_PATH}
+)
+
+set_source_files_properties(
+ ${project_VALA_SOURCES}
+ PROPERTIES
+ HEADER_FILE_ONLY TRUE
+)
+
+set(
+ INDICATOR_SOUND_SOURCES
+ ${project_VALA_SOURCES}
+ ${project_VALA_C}
+ ${SYMBOLS_PATH}
+)
+
+###########################
+# Executable
+###########################
+
+add_definitions(
+ -w
+)
+
+add_executable(
+ indicator-sound-service-bin
+ ${INDICATOR_SOUND_SOURCES}
+)
+
+set_target_properties(
+ indicator-sound-service-bin
+ PROPERTIES
+ OUTPUT_NAME "indicator-sound-service"
+)
+
+target_link_libraries(
+ indicator-sound-service-bin
+ ${PULSEAUDIO_LIBRARIES}
+ ${SOUNDSERVICE_LIBRARIES}
+)
+
+###########################
+# Installation
+###########################
+
+install(
+ TARGETS indicator-sound-service-bin
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}
+)
+
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 8af02ce..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-pkglibexec_PROGRAMS = indicator-sound-service
-
-indicator_sound_service_SOURCES = \
- service.vala \
- main.vala \
- volume-control.vala \
- media-player.vala \
- media-player-list.vala \
- mpris2-interfaces.vala \
- mpris2-watcher.vala \
- freedesktop-interfaces.vala \
- sound-menu.vala
-
-indicator_sound_service_VALAFLAGS = \
- --ccode \
- --vapidir=$(top_srcdir)/vapi/ \
- --vapidir=./ \
- --thread \
- --pkg config \
- --pkg gio-2.0 \
- --pkg gio-unix-2.0 \
- --pkg libxml-2.0 \
- --pkg libpulse \
- --pkg libpulse-mainloop-glib \
- --target-glib=2.36
-
-# -w to disable warnings for vala-generated code
-indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) \
- $(SOUNDSERVICE_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -w \
- -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"
-
-indicator_sound_service_LDADD = $(PULSEAUDIO_LIBS) $(SOUNDSERVICE_LIBS) $(GCONF_LIBS)
-indicator_sound_service_LDFLAGS = $(COVERAGE_LDFLAGS)
diff --git a/src/service.vala b/src/service.vala
index 690fdce..ac3ba5b 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -17,9 +17,6 @@
* Lars Uebernickel <lars.uebernickel@canonical.com>
*/
-/* Icon.serialize() is not yet in gio-2.0.vapi; remove this when it is */
-extern Variant? g_icon_serialize (Icon icon);
-
public class IndicatorSound.Service {
public Service () {
this.settings = new Settings ("com.canonical.indicator.sound");
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index de5500e..415a5be 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -17,6 +17,9 @@
* Lars Uebernickel <lars.uebernickel@canonical.com>
*/
+/* Icon.serialize() is not yet in gio-2.0.vapi; remove this when it is */
+extern Variant? g_icon_serialize (Icon icon);
+
class SoundMenu: Object
{
public SoundMenu (string settings_action) {