diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
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} |