From c24491c2c916220648802e5e711e923c7685ee9d Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 26 Mar 2015 15:59:22 +0100 Subject: Use pkg-config to determine GI support --- src/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3d94c98..762b308 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,10 +62,15 @@ endif () #}}} #{{{ GObject introspection -if (INTROSPECTION_SCANNER AND INTROSPECTION_COMPILER) +pkg_check_modules(GOBJECT_INTROSPECTION gobject-introspection-1.0) + +if (GOBJECT_INTROSPECTION_FOUND) option(WITH_GIR "Build introspection files" ON) if (WITH_GIR) + pkg_check_variable(gobject-introspection-1.0 g_ir_scanner) + pkg_check_variable(gobject-introspection-1.0 g_ir_compiler) + set(GIR_PREFIX "Uca-${UCA_ABI_VERSION}.0") set(GIR_XML "${GIR_PREFIX}.gir") set(GIR_TYPELIB "${GIR_PREFIX}.typelib") @@ -79,7 +84,7 @@ if (INTROSPECTION_SCANNER AND INTROSPECTION_COMPILER) list(APPEND _gir_input "${CMAKE_CURRENT_BINARY_DIR}/uca-enums.c") add_custom_command(OUTPUT ${GIR_XML} - COMMAND ${INTROSPECTION_SCANNER} + COMMAND ${GOBJECT_INTROSPECTION_1.0_G_IR_SCANNER} --namespace=Uca --nsversion=${UCA_ABI_VERSION} --library=uca @@ -94,7 +99,7 @@ if (INTROSPECTION_SCANNER AND INTROSPECTION_COMPILER) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_custom_command(OUTPUT ${GIR_TYPELIB} - COMMAND ${INTROSPECTION_COMPILER} + COMMAND ${GOBJECT_INTROSPECTION_1.0_G_IR_COMPILER} -o ${GIR_TYPELIB} ${GIR_XML} DEPENDS ${GIR_XML} -- cgit v1.2.3