| 1 |
|
| 2 |
add_library(ayatana-common SHARED |
| 3 |
utils.c |
| 4 |
) |
| 5 |
|
| 6 |
target_link_libraries(ayatana-common |
| 7 |
${DEPS_LIBRARIES} |
| 8 |
) |
| 9 |
|
| 10 |
target_compile_definitions (ayatana-common PUBLIC GETTEXT_PACKAGE="${GETTEXT_PACKAGE}" LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}") |
| 11 |
|
| 12 |
if(ENABLE_LOMIRI_FEATURES) |
| 13 |
add_definitions( -DLOMIRI_FEATURES_ENABLED ) |
| 14 |
endif() |
| 15 |
|
| 16 |
set(PUBLIC_HEADERS |
| 17 |
utils.h |
| 18 |
) |
| 19 |
|
| 20 |
set_target_properties(ayatana-common |
| 21 |
PROPERTIES |
| 22 |
VERSION ${API_VERSION}.1.0 |
| 23 |
SOVERSION ${ABI_VERSION} |
| 24 |
) |
| 25 |
|
| 26 |
configure_file(libayatana-common.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libayatana-common.pc @ONLY) |
| 27 |
|
| 28 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libayatana-common.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig) |
| 29 |
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/ayatana/common) |
| 30 |
install(TARGETS ayatana-common DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) |
| 31 |
|
| 32 |
# AyatanaCommon.gir |
| 33 |
|
| 34 |
if (INTROSPECTION_FOUND) |
| 35 |
add_custom_command( |
| 36 |
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.gir" |
| 37 |
DEPENDS "ayatana-common" |
| 38 |
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 39 |
COMMAND |
| 40 |
${INTROSPECTION_SCANNER} |
| 41 |
utils.c utils.h |
| 42 |
--no-libtool |
| 43 |
--namespace=AyatanaCommon |
| 44 |
--nsversion=0.1 |
| 45 |
--c-include=ayatana/common/utils.h |
| 46 |
--quiet |
| 47 |
--warn-all |
| 48 |
--include=GLib-2.0 |
| 49 |
--library="ayatana-common" |
| 50 |
--library-path=${CMAKE_CURRENT_BINARY_DIR} |
| 51 |
--output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.gir" |
| 52 |
) |
| 53 |
|
| 54 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0") |
| 55 |
|
| 56 |
# AyatanaCommon.typelib |
| 57 |
|
| 58 |
add_custom_command( |
| 59 |
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.typelib" |
| 60 |
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.gir" |
| 61 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
| 62 |
COMMAND |
| 63 |
${INTROSPECTION_COMPILER} |
| 64 |
--includedir=${CMAKE_CURRENT_BINARY_DIR} |
| 65 |
${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.gir |
| 66 |
-o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.typelib" |
| 67 |
) |
| 68 |
|
| 69 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0") |
| 70 |
|
| 71 |
# AyatanaCommon.vapi |
| 72 |
|
| 73 |
if (VALA_COMPILER) |
| 74 |
add_custom_command( |
| 75 |
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi" |
| 76 |
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.typelib" |
| 77 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
| 78 |
COMMAND |
| 79 |
${VAPI_GEN} |
| 80 |
--library=AyatanaCommon |
| 81 |
AyatanaCommon-0.1.gir |
| 82 |
) |
| 83 |
|
| 84 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi") |
| 85 |
|
| 86 |
add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon.vapi") |
| 87 |
|
| 88 |
else() |
| 89 |
|
| 90 |
add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.1.typelib") |
| 91 |
|
| 92 |
endif() |
| 93 |
|
| 94 |
endif() |