2017-03-10 15:16:48 +00:00
|
|
|
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
|
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
|
|
|
|
OPTIONS
|
|
|
|
-g
|
|
|
|
--thread
|
|
|
|
)
|
|
|
|
|
2017-03-10 18:34:56 +00:00
|
|
|
set(CFLAGS ${VALA_CFLAGS} ${GPGME_VALA_CFLAGS} ${GPGME_CFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/src)
|
2017-03-10 15:16:48 +00:00
|
|
|
add_definitions(${CFLAGS})
|
2017-03-11 11:13:06 +00:00
|
|
|
add_library(gpgme-vala SHARED ${GPGME_VALA_C} src/gpgme_fix.c)
|
2017-03-10 15:16:48 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|