aboutsummaryrefslogtreecommitdiff
path: root/gpgme-vala/CMakeLists.txt
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-10 16:16:48 +0100
committerfiaxh <git@mx.ax.lt>2017-03-10 17:29:23 +0100
commit9b8cf706d6b0ff83472af53c31b96c4c2f55f6b7 (patch)
treef31048126f135156da9d98f20cb4254933d9841d /gpgme-vala/CMakeLists.txt
parent2fe8489d368a371aefbfbe66e74621a8df14cdc2 (diff)
downloaddino-9b8cf706d6b0ff83472af53c31b96c4c2f55f6b7.tar.gz
dino-9b8cf706d6b0ff83472af53c31b96c4c2f55f6b7.zip
Outfactor PGP into pgpme-vala
Diffstat (limited to 'gpgme-vala/CMakeLists.txt')
-rw-r--r--gpgme-vala/CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/gpgme-vala/CMakeLists.txt b/gpgme-vala/CMakeLists.txt
new file mode 100644
index 00000000..322b4e37
--- /dev/null
+++ b/gpgme-vala/CMakeLists.txt
@@ -0,0 +1,48 @@
+find_package(Vala REQUIRED)
+find_package(PkgConfig REQUIRED)
+find_package(GPGME REQUIRED)
+include(${VALA_USE_FILE})
+
+set(GPGME_VALA_PACKAGES
+ gee-0.8
+ glib-2.0
+)
+
+pkg_check_modules(GPGME_VALA REQUIRED ${GPGME_VALA_PACKAGES})
+
+vala_precompile(GPGME_VALA_C
+SOURCES
+ "src/gpgme-helper.vala"
+CUSTOM_VAPIS
+ "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme.vapi"
+ "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi"
+ "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpg-error.vapi"
+PACKAGES
+ ${GPGME_VALA_PACKAGES}
+GENERATE_VAPI
+ gpgme-vala
+GENERATE_HEADER
+ gpgme-vala
+OPTIONS
+ -g
+ --thread
+)
+
+set(CFLAGS ${GPGME_VALA_CFLAGS} ${GPGME_CFLAGS} -g ${VALA_CFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/src)
+add_definitions(${CFLAGS})
+add_library(gpgme-vala SHARED ${GPGME_VALA_C} src/fix.c)
+target_link_libraries(gpgme-vala ${GPGME_VALA_LIBRARIES} ${GPGME_LIBRARIES})
+
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gpgme-vala/gpgme.vapi
+COMMAND
+ cat "${CMAKE_BINARY_DIR}/gpgme-vala/gpgme-vala.vapi" "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi" > "${CMAKE_BINARY_DIR}/gpgme-vala/gpgme.vapi"
+DEPENDS
+ ${CMAKE_BINARY_DIR}/gpgme-vala/gpgme-vala.vapi
+ ${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi
+)
+
+add_custom_target(gpgme-vapi
+DEPENDS
+ ${CMAKE_BINARY_DIR}/gpgme-vala/gpgme.vapi
+)
+