diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-03-26 15:59:22 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-03-26 15:59:22 +0100 |
commit | c24491c2c916220648802e5e711e923c7685ee9d (patch) | |
tree | ae362a7b7d8de6f343ad288f2821a0881b714b60 /src | |
parent | ed1f4eb5c9dc1ae02d95034551bf6640b393e754 (diff) | |
download | libuca-c24491c2c916220648802e5e711e923c7685ee9d.tar.gz libuca-c24491c2c916220648802e5e711e923c7685ee9d.tar.bz2 libuca-c24491c2c916220648802e5e711e923c7685ee9d.tar.xz libuca-c24491c2c916220648802e5e711e923c7685ee9d.zip |
Use pkg-config to determine GI support
Diffstat (limited to 'src')
-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} |