| 1 |
ecm_setup_version(PROJECT VARIABLE_PREFIX FCITX5QT5DBUSADDONS |
| 2 |
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt5dbusaddons_version.h" |
| 3 |
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt5DBusAddonsConfigVersion.cmake" |
| 4 |
SOVERSION 1) |
| 5 |
|
| 6 |
# create a Config.cmake and a ConfigVersion.cmake file and install them |
| 7 |
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Qt5DBusAddons") |
| 8 |
|
| 9 |
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/Fcitx5Qt5DBusAddonsConfig.cmake.in" |
| 10 |
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt5DBusAddonsConfig.cmake" |
| 11 |
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} |
| 12 |
) |
| 13 |
|
| 14 |
set(dbusaddons_SOURCES |
| 15 |
fcitxqtwatcher.cpp |
| 16 |
fcitxqtdbustypes.cpp |
| 17 |
fcitxqtinputcontextproxy.cpp |
| 18 |
fcitxqtinputcontextproxyimpl.cpp |
| 19 |
fcitxqtinputmethodproxy.cpp |
| 20 |
fcitxqtcontrollerproxy.cpp |
| 21 |
) |
| 22 |
|
| 23 |
set(dbusaddons_HEADERS |
| 24 |
fcitxqtwatcher.h |
| 25 |
fcitxqtdbustypes.h |
| 26 |
fcitxqtinputcontextproxy.h |
| 27 |
fcitxqtinputmethodproxy.h |
| 28 |
fcitxqtcontrollerproxy.h |
| 29 |
) |
| 30 |
|
| 31 |
set(fcitxqtdbusaddons_INCLUDE_DIRS |
| 32 |
${CMAKE_CURRENT_BINARY_DIR} |
| 33 |
${CMAKE_CURRENT_SOURCE_DIR} |
| 34 |
) |
| 35 |
|
| 36 |
add_library(Fcitx5Qt5DBusAddons ${LIBRARY_TYPE} ${dbusaddons_SOURCES}) |
| 37 |
generate_export_header(Fcitx5Qt5DBusAddons BASE_NAME Fcitx5Qt5DBusAddons) |
| 38 |
add_library(Fcitx5Qt5::DBusAddons ALIAS Fcitx5Qt5DBusAddons) |
| 39 |
|
| 40 |
target_include_directories(Fcitx5Qt5DBusAddons PUBLIC "$<BUILD_INTERFACE:${fcitxqtdbusaddons_INCLUDE_DIRS}>") |
| 41 |
target_include_directories(Fcitx5Qt5DBusAddons INTERFACE "$<INSTALL_INTERFACE:${Fcitx5Qt5_INCLUDE_INSTALL_DIR}/Fcitx5Qt5DBusAddons>") |
| 42 |
|
| 43 |
set_target_properties(Fcitx5Qt5DBusAddons |
| 44 |
PROPERTIES VERSION ${FCITX5QT5DBUSADDONS_VERSION} |
| 45 |
AUTOMOC TRUE |
| 46 |
SOVERSION ${FCITX5QT5DBUSADDONS_SOVERSION} |
| 47 |
POSITION_INDEPENDENT_CODE ON |
| 48 |
EXPORT_NAME DBusAddons |
| 49 |
) |
| 50 |
|
| 51 |
target_link_libraries( |
| 52 |
Fcitx5Qt5DBusAddons |
| 53 |
PUBLIC |
| 54 |
Qt5::Core |
| 55 |
Qt5::DBus |
| 56 |
) |
| 57 |
|
| 58 |
if(BUILD_ONLY_PLUGIN) |
| 59 |
set_target_properties(Fcitx5Qt5DBusAddons PROPERTIES |
| 60 |
COMPILE_DEFINITIONS "FCITX5QT5DBUSADDONS_STATIC_DEFINE") |
| 61 |
|
| 62 |
else() |
| 63 |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt5DBusAddonsConfig.cmake" |
| 64 |
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt5DBusAddonsConfigVersion.cmake" |
| 65 |
DESTINATION "${CMAKECONFIG_INSTALL_DIR}" |
| 66 |
COMPONENT Devel ) |
| 67 |
|
| 68 |
install(EXPORT Fcitx5Qt5DBusAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Fcitx5Qt5DBusAddonsTargets.cmake NAMESPACE Fcitx5Qt5:: ) |
| 69 |
|
| 70 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt5dbusaddons_version.h |
| 71 |
DESTINATION ${Fcitx5Qt5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) |
| 72 |
|
| 73 |
install(TARGETS Fcitx5Qt5DBusAddons EXPORT Fcitx5Qt5DBusAddonsTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
| 74 |
|
| 75 |
install(FILES ${dbusaddons_HEADERS} |
| 76 |
${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt5dbusaddons_export.h |
| 77 |
DESTINATION "${Fcitx5Qt5_INCLUDE_INSTALL_DIR}/Fcitx5Qt5DBusAddons") |
| 78 |
endif() |
| 79 |
|
| 80 |
|