aboutsummaryrefslogtreecommitdiff
path: root/libmessaging-menu/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-21 22:27:03 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-21 22:27:03 +0200
commitb2beaa3431ac84614ae45f58f2771fb6b97f6201 (patch)
tree61b44606d995290f8fcd062f15176a8adc8fceb1 /libmessaging-menu/CMakeLists.txt
parent9ad235af84652bc64c1d28a6b2c68eb55e1b401c (diff)
parent421e9dcda36265642403c42b687e80769506b5b1 (diff)
downloadayatana-indicator-messages-b2beaa3431ac84614ae45f58f2771fb6b97f6201.tar.gz
ayatana-indicator-messages-b2beaa3431ac84614ae45f58f2771fb6b97f6201.tar.bz2
ayatana-indicator-messages-b2beaa3431ac84614ae45f58f2771fb6b97f6201.zip
Merge branch 'tari01-pr/move-to-cmake'
Attributes GH PR #19: https://github.com/AyatanaIndicators/ayatana-indicator-messages/pull/19
Diffstat (limited to 'libmessaging-menu/CMakeLists.txt')
-rw-r--r--libmessaging-menu/CMakeLists.txt101
1 files changed, 101 insertions, 0 deletions
diff --git a/libmessaging-menu/CMakeLists.txt b/libmessaging-menu/CMakeLists.txt
new file mode 100644
index 0000000..2d3d6ac
--- /dev/null
+++ b/libmessaging-menu/CMakeLists.txt
@@ -0,0 +1,101 @@
+# messaging-menu.pc
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/messaging-menu.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/messaging-menu.pc" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/messaging-menu.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
+
+# messaging-menu-app.h
+# messaging-menu-message.h
+# messaging-menu.h
+
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/messaging-menu-app.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/messaging-menu")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/messaging-menu-message.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/messaging-menu")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/messaging-menu.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/messaging-menu")
+
+# libmessaging-menu.so
+
+set(
+ SOURCES
+ messaging-menu-app.c
+ messaging-menu-message.c
+)
+
+set(
+ SOURCES_GEN
+ ${CMAKE_BINARY_DIR}/src/indicator-messages-service.c
+ ${CMAKE_BINARY_DIR}/src/indicator-messages-application.c
+)
+
+set_source_files_properties(${SOURCES_GEN} PROPERTIES GENERATED TRUE)
+set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+add_library("messaging-menu" SHARED ${SOURCES} ${SOURCES_GEN})
+set_target_properties("messaging-menu" PROPERTIES VERSION 0.0.0 SOVERSION 0)
+target_include_directories("messaging-menu" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS} "${CMAKE_BINARY_DIR}/src")
+target_link_libraries("messaging-menu" ${PROJECT_DEPS_LIBRARIES})
+add_dependencies("messaging-menu" "ayatana-indicator-messages-service")
+install(TARGETS "messaging-menu" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
+
+# MessagingMenu-1.0.gir
+
+find_package(GObjectIntrospection REQUIRED)
+
+set(
+ HEADERS
+ messaging-menu-app.h
+ messaging-menu-message.h
+)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.gir"
+ DEPENDS "messaging-menu"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${INTROSPECTION_SCANNER}
+ ${HEADERS} ${SOURCES}
+ --namespace=MessagingMenu
+ --nsversion=1.0
+ --quiet
+ --warn-all
+ --include=GObject-2.0
+ --include=Gio-2.0
+ --pkg-export=messaging-menu
+ --library="messaging-menu"
+ --c-include="messaging-menu.h"
+ --library-path=${CMAKE_CURRENT_BINARY_DIR}
+ --output "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.gir"
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0")
+
+# MessagingMenu-1.0.typelib
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.typelib"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.gir"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${INTROSPECTION_COMPILER}
+ --includedir=${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.gir
+ -o "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.typelib"
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0")
+
+# MessagingMenu-1.0.vapi
+
+find_package(Vala REQUIRED)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.vapi"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.typelib"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${VAPI_GEN}
+ --library=MessagingMenu-1.0
+ --pkg gio-2.0
+ MessagingMenu-1.0.gir
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi")
+
+add_custom_target("libmessaging-menu" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/MessagingMenu-1.0.vapi")