aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt112
-rw-r--r--src/Makefile.am113
-rw-r--r--src/ayatana-appindicator3-0.1.pc.in14
3 files changed, 112 insertions, 127 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..e328688
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,112 @@
+# gen-ayatana-application-service.xml.h
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-ayatana-application-service.xml.h" "extern const char * _ayatana_application_service;")
+
+# gen-ayatana-application-service.xml.c
+
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-application-service.xml" GEN_AYATANA_APPLICATION_SERVICE_XML_C)
+string(REPLACE "\"" "\\\"" GEN_AYATANA_APPLICATION_SERVICE_XML_C ${GEN_AYATANA_APPLICATION_SERVICE_XML_C})
+string(REPLACE "\n" "\\n\"\n\"" GEN_AYATANA_APPLICATION_SERVICE_XML_C ${GEN_AYATANA_APPLICATION_SERVICE_XML_C})
+string(REGEX REPLACE "\n\"$" "\n" GEN_AYATANA_APPLICATION_SERVICE_XML_C ${GEN_AYATANA_APPLICATION_SERVICE_XML_C})
+string(PREPEND GEN_AYATANA_APPLICATION_SERVICE_XML_C "const char * _ayatana_application_service = \n\"")
+string(APPEND GEN_AYATANA_APPLICATION_SERVICE_XML_C "\;")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-ayatana-application-service.xml.c" ${GEN_AYATANA_APPLICATION_SERVICE_XML_C})
+
+# ayatana-application-service-marshal.h
+
+find_program(GLIB_GENMARSHAL glib-genmarshal)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.h"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${GLIB_GENMARSHAL}
+ --prefix=_ayatana_application_service_marshal
+ --header ayatana-application-service-marshal.list
+ --quiet
+ --output="${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.h"
+)
+
+# ayatana-application-service-marshal.c
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.c"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.h"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${GLIB_GENMARSHAL}
+ --prefix=_ayatana_application_service_marshal
+ --body ayatana-application-service-marshal.list
+ --include-header=ayatana-application-service-marshal.h
+ --quiet
+ --output="${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.c"
+)
+
+# ayatana-notification-watcher-server.h
+
+find_program(DBUS_BINDING_TOOL dbus-binding-tool)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-notification-watcher-server.h"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ayatana-application-service-marshal.c"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${DBUS_BINDING_TOOL}
+ --prefix=_ayatana_notification_watcher_server
+ --mode=glib-server
+ --output="${CMAKE_CURRENT_BINARY_DIR}/ayatana-notification-watcher-server.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-notification-watcher.xml"
+)
+
+# ayatana-notification-watcher-client.h
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-notification-watcher-client.h"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ayatana-notification-watcher-server.h"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${DBUS_BINDING_TOOL}
+ --prefix=_ayatana_notification_watcher_client
+ --mode=glib-client
+ --output="${CMAKE_CURRENT_BINARY_DIR}/ayatana-notification-watcher-client.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-notification-watcher.xml"
+)
+
+add_custom_target("src-generated" DEPENDS "ayatana-notification-watcher-client.h")
+
+# libayatana-application.so
+
+set(SOURCES
+ ayatana-application-service-marshal.c
+ indicator-application.c
+)
+
+set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+add_library("ayatana-application" SHARED ${SOURCES})
+target_compile_definitions("ayatana-application" PUBLIC G_LOG_DOMAIN="Ayatana-Indicator-Application")
+target_include_directories("ayatana-application" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
+target_include_directories("ayatana-application" PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries("ayatana-application" ${PROJECT_DEPS_LIBRARIES})
+add_dependencies("ayatana-application" "src-generated")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-application.so" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ayatana-indicators3/7")
+
+# ayatana-indicator-application-service
+
+set(SOURCES
+ application-service.c
+ application-service-appstore.c
+ ayatana-application-service-marshal.c
+ application-service-watcher.c
+ gen-ayatana-application-service.xml.c
+ generate-id.c
+)
+
+set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+add_executable("ayatana-indicator-application-service" ${SOURCES})
+target_compile_definitions("ayatana-indicator-application-service" PUBLIC DATADIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/ayatana-indicator-application")
+target_compile_definitions("ayatana-indicator-application-service" PUBLIC G_LOG_DOMAIN="ayatana-indicator-application-service")
+target_include_directories("ayatana-indicator-application-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
+target_include_directories("ayatana-indicator-application-service" PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries("ayatana-indicator-application-service" ${PROJECT_DEPS_LIBRARIES})
+add_dependencies("ayatana-indicator-application-service" "ayatana-application")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-application-service" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}/ayatana-indicator-application")
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 916b745..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,113 +0,0 @@
-CLEANFILES =
-DISTCLEANFILES =
-BUILT_SOURCES =
-EXTRA_DIST =
-
-include $(top_srcdir)/Makefile.am.marshal
-
-##################################
-# Indicator
-##################################
-
-applicationlibdir = $(INDICATORDIR)
-applicationlib_LTLIBRARIES = libayatana-application.la
-libayatana_application_la_SOURCES = \
- ayatana-application-service-marshal.c \
- dbus-shared.h \
- indicator-application.c
-libayatana_application_la_CFLAGS = $(INDICATOR_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- -Wall \
- -Wl,-Bsymbolic-functions \
- -Wl,-z,defs \
- -Wl,--as-needed \
- -Wno-error=deprecated-declarations \
- -DG_LOG_DOMAIN=\"Ayatana-Indicator-Application\"
-libayatana_application_la_LIBADD = $(INDICATOR_LIBS)
-libayatana_application_la_LDFLAGS = $(COVERAGE_LDFLAGS) \
- -module -avoid-version
-
-##################################
-# Service
-##################################
-
-pkglibexec_PROGRAMS = ayatana-indicator-application-service
-
-BUILT_SOURCES += \
- ayatana-application-service-marshal.h \
- ayatana-application-service-marshal.c \
- ayatana-notification-watcher-server.h
-
-ayatana_indicator_application_service_SOURCES = \
- application-service.c \
- application-service-appstore.h \
- application-service-appstore.c \
- ayatana-application-service-marshal.c \
- application-service-watcher.h \
- application-service-watcher.c \
- gen-ayatana-application-service.xml.c \
- dbus-shared.h \
- generate-id.h \
- generate-id.c
-
-ayatana_indicator_application_service_CFLAGS = \
- $(INDICATOR_CFLAGS) \
- $(APPINDICATOR_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- -DDATADIR="\"$(pkgdatadir)\"" \
- -Wall -Wno-error=deprecated-declarations \
- -DG_LOG_DOMAIN=\"ayatana-indicator-application-service\"
-
-ayatana_indicator_application_service_LDADD = \
- $(INDICATOR_LIBS) \
- $(APPINDICATOR_LIBS)
-
-ayatana_indicator_application_service_LDFLAGS = \
- $(COVERAGE_LDFLAGS)
-
-glib_marshal_list = ayatana-application-service-marshal.list
-glib_marshal_prefix = _ayatana_application_service_marshal
-
-##################################
-# DBus Specs
-##################################
-
-GDBUS_SPECS = \
- ayatana-application-service.xml
-
-DBUS_SPECS = \
- ayatana-notification-watcher.xml
-
-%-client.h: %.xml
- dbus-binding-tool \
- --prefix=_$(notdir $(subst -,_,$(<:.xml=)))_client \
- --mode=glib-client \
- --output=$@ \
- $<
-
-%-server.h: %.xml
- dbus-binding-tool \
- --prefix=_$(notdir $(subst -,_,$(<:.xml=)))_server \
- --mode=glib-server \
- --output=$@ \
- $<
-
-gen-%.xml.c: %.xml
- @echo "Building $@ from $<"
- @echo "const char * _$(notdir $(subst -,_,$(subst .,_,$(basename $<)))) = " > $@
- @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
- @echo ";" >> $@
-
-gen-%.xml.h: %.xml
- @echo "Building $@ from $<"
- @echo "extern const char * _$(notdir $(subst -,_,$(subst .,_,$(basename $<))));" > $@
-
-BUILT_SOURCES += \
- $(DBUS_SPECS:.xml=-client.h) \
- $(DBUS_SPECS:.xml=-server.h) \
- gen-ayatana-application-service.xml.c \
- gen-ayatana-application-service.xml.h
-
-CLEANFILES += $(BUILT_SOURCES)
-
-EXTRA_DIST += $(DBUS_SPECS) $(GDBUS_SPECS)
diff --git a/src/ayatana-appindicator3-0.1.pc.in b/src/ayatana-appindicator3-0.1.pc.in
deleted file mode 100644
index e02bdbd..0000000
--- a/src/ayatana-appindicator3-0.1.pc.in
+++ /dev/null
@@ -1,14 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-bindir=@bindir@
-includedir=@includedir@
-
-Cflags: -I${includedir}/libayatana-appindicator3-0.1
-Requires: dbusmenu-glib gtk+-3.0
-Libs: -L${libdir} -layatana-appindicator3
-
-Name: ayatana-appindicator3-0.1
-Description: Application indicators
-Version: @VERSION@
-