aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt41
-rw-r--r--src/utils.h14
2 files changed, 48 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0189cc1..637ce9f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,3 +27,44 @@ configure_file(libayatana-common.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libayatana-co
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libayatana-common.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig)
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/ayatana/common)
install(TARGETS ayatana-common DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
+
+# AyatanaCommon.gir
+
+find_package(GObjectIntrospection REQUIRED QUIET)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.gir"
+ DEPENDS "ayatana-common"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${INTROSPECTION_SCANNER}
+ utils.c utils.h
+ --namespace=AyatanaCommon
+ --c-include=ayatana/common/utils.h
+ --quiet
+ --warn-all
+ --include=GLib-2.0
+ --library="ayatana-common"
+ --library-path=${CMAKE_CURRENT_BINARY_DIR}
+ --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.gir"
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0")
+
+# AyatanaCommon.vapi
+
+find_package(Vala REQUIRED QUIET)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.gir"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${VAPI_GEN}
+ --library=AyatanaCommon
+ AyatanaCommon.gir
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi")
+
+add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi")
diff --git a/src/utils.h b/src/utils.h
index 3098146..b8e70cb 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -22,13 +22,13 @@
#include <glib-object.h>
#include <gio/gio.h>
-#define DESKTOP_LOMIRI "Lomiri"
-#define DESKTOP_UNITY "Unity"
-#define DESKTOP_MATE "MATE"
-#define DESKTOP_GNOME "GNOME"
-#define DESKTOP_XFCE "XFCE"
-#define DESKTOP_PANTHEON "PANTHEON"
-#define DESKTOP_BUDGIE "Budgie"
+static const char *DESKTOP_LOMIRI = "Lomiri";
+static const char *DESKTOP_UNITY = "Unity";
+static const char *DESKTOP_MATE = "MATE";
+static const char *DESKTOP_GNOME = "GNOME";
+static const char *DESKTOP_XFCE = "XFCE";
+static const char *DESKTOP_PANTHEON = "PANTHEON";
+static const char *DESKTOP_BUDGIE = "Budgie";
gboolean ayatana_common_utils_is_lomiri();
gboolean ayatana_common_utils_is_unity();