Auto-generate Vala API file, if desired
[appstream:appstream.git] / data / vapi / CMakeLists.txt
1 # Vala API
2
3 set(APPSTREAM_VAPI_FILE "${CMAKE_CURRENT_BINARY_DIR}/appstream.vapi")
4
5 add_custom_command (OUTPUT ${APPSTREAM_VAPI_FILE}
6                         COMMAND vapigen --metadatadir=${CMAKE_CURRENT_SOURCE_DIR} -d . --vapidir=${CMAKE_CURRENT_SOURCE_DIR}
7                                         ${CMAKE_BINARY_DIR}/src/Appstream-${AS_VERSION_BASE}.gir
8                                         --library=appstream
9                                         --pkg glib-2.0 --pkg gio-2.0 --pkg gobject-2.0
10                         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
11                         DEPENDS appstream
12                                         ${CMAKE_BINARY_DIR}/src/Appstream-${AS_VERSION_BASE}.typelib
13                         VERBATIM
14 )
15 add_custom_target(vapi ALL DEPENDS ${APPSTREAM_VAPI_FILE})
16
17 install(FILES ${APPSTREAM_VAPI_FILE} DESTINATION share/vala/vapi)