aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorGuido Berhoerster <guido+ayatana@berhoerster.name>2021-03-01 19:13:17 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-10 09:56:51 +0200
commit808727b9b49328d8e46097fccdd1614de774ed00 (patch)
tree596942f70f2a6a98680e7344afca0d351976c613 /src/CMakeLists.txt
parent2ea7c4ae2e9c93d698f4d9065ebd5a49904720c6 (diff)
downloadlibayatana-appindicator-808727b9b49328d8e46097fccdd1614de774ed00.tar.gz
libayatana-appindicator-808727b9b49328d8e46097fccdd1614de774ed00.tar.bz2
libayatana-appindicator-808727b9b49328d8e46097fccdd1614de774ed00.zip
Add macros for compile-time version checking
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3e5f591..b0990a8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,11 @@ elseif (FLAVOUR_GTK2)
set (gtk_girver "Gtk-2.0")
endif()
+set(GIR_SOURCES
+ app-indicator.c
+ app-indicator.h
+)
+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/app-indicator.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/lib${ayatana_appindicator_gtkver}-0.1/libayatana-appindicator")
# ayatana-appindicator{,3}-0.1.pc
@@ -132,16 +137,24 @@ install(TARGETS "${ayatana_appindicator_gtkver}" LIBRARY DESTINATION "${CMAKE_IN
# AyatanaAppIndicator{,3}-0.1.gir
+add_custom_command(
+ TARGET "${ayatana_appindicator_gtkver}" PRE_BUILD
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${CMAKE_COMMAND}
+ -E copy
+ ${GIR_SOURCES}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
find_package(GObjectIntrospection REQUIRED)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${ayatana_appindicator_girver}-0.1.gir"
DEPENDS "${ayatana_appindicator_gtkver}"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND
${INTROSPECTION_SCANNER}
- app-indicator.c ${HEADERS}
- --add-include-path=${CMAKE_CURRENT_BINARY_DIR}
+ ${GIR_SOURCES}
--c-include=libayatana-appindicator/app-indicator.h
--symbol-prefix=app
--identifier-prefix=App
@@ -173,3 +186,9 @@ add_custom_command(
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ayatana_appindicator_girver}-0.1.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0")
add_custom_target(src ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${ayatana_appindicator_girver}-0.1.typelib")
+
+# app-indicator-version.h
+
+configure_file(app-indicator-version.h.in app-indicator-version.h @ONLY)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-version.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/lib${ayatana_appindicator_gtkver}-0.1/libayatana-appindicator")