2017-03-10 15:16:48 +00:00
|
|
|
find_package(GPGME REQUIRED)
|
2017-03-23 16:10:45 +00:00
|
|
|
find_packages(GPGME_VALA_PACKAGES REQUIRED
|
|
|
|
Gee
|
|
|
|
GLib
|
|
|
|
GObject
|
2017-03-10 15:16:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
vala_precompile(GPGME_VALA_C
|
|
|
|
SOURCES
|
2017-03-11 11:13:06 +00:00
|
|
|
"src/gpgme_helper.vala"
|
2017-03-10 15:16:48 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2017-03-11 22:20:25 +00:00
|
|
|
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/gpgme_fix.h"
|
2017-03-10 15:16:48 +00:00
|
|
|
COMMAND
|
2017-03-11 22:20:25 +00:00
|
|
|
cp "${CMAKE_CURRENT_SOURCE_DIR}/src/gpgme_fix.h" "${CMAKE_BINARY_DIR}/exports/gpgme_fix.h"
|
2017-03-10 15:16:48 +00:00
|
|
|
DEPENDS
|
2017-03-11 22:20:25 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/gpgme_fix.h"
|
|
|
|
COMMENT
|
|
|
|
Copy header file gpgme_fix.h
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/exports/gpgme.vapi
|
|
|
|
COMMAND
|
|
|
|
cat "${CMAKE_BINARY_DIR}/exports/gpgme-vala.vapi" "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi" > "${CMAKE_BINARY_DIR}/exports/gpgme.vapi"
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_BINARY_DIR}/exports/gpgme-vala.vapi
|
2017-03-10 15:16:48 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(gpgme-vapi
|
|
|
|
DEPENDS
|
2017-03-11 22:20:25 +00:00
|
|
|
${CMAKE_BINARY_DIR}/exports/gpgme_fix.h
|
|
|
|
${CMAKE_BINARY_DIR}/exports/gpgme.vapi
|
2017-03-10 15:16:48 +00:00
|
|
|
)
|
|
|
|
|
2017-04-23 08:01:40 +00:00
|
|
|
set(CFLAGS ${VALA_CFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|
|
|
add_definitions(${CFLAGS})
|
|
|
|
add_library(gpgme-vala ${GPGME_VALA_C} src/gpgme_fix.c)
|
|
|
|
add_dependencies(gpgme-vala gpgme-vapi)
|
|
|
|
target_link_libraries(gpgme-vala ${GPGME_VALA_PACKAGES} gpgme)
|
|
|
|
set_property(TARGET gpgme-vala PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|