2 include_directories(${KDEBASE_WORKSPACE_SOURCE_DIR}/kcontrol/fonts
3 ${KDEBASE_WORKSPACE_SOURCE_DIR}/kcontrol/kfontinst/kcmfontinst
4 ${CMAKE_CURRENT_BINARY_DIR})
6 # kio_fonts_helper can use PolicyKit if this is installed...
7 if (KFI_USE_POLICY_KIT AND POLKITDBUS_FOUND)
9 set(kio_fonts_PART_SRCS KioFonts.cpp ${libkxftconfig_SRCS} ${kfi_polkit_auth_SRCS})
11 qt4_add_dbus_interface(kio_fonts_PART_SRCS org.kde.fontinst.xml FontInstInterface )
13 execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} polkit --variable=policydir
14 OUTPUT_VARIABLE POLICY_DIR)
15 string(REGEX REPLACE "[\r\n]" "" POLICY_DIR "${POLICY_DIR}")
17 execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} dbus-1 --variable=sysconfdir
18 OUTPUT_VARIABLE DBUS_SYSCONF_DIR)
19 string(REGEX REPLACE "[\r\n]" "" DBUS_SYSCONF_DIR "${DBUS_SYSCONF_DIR}")
21 execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} dbus-1 --variable=session_bus_services_dir
22 OUTPUT_VARIABLE DBUS_SESSION_SRV_DIR)
23 string(REGEX REPLACE "[\r\n]" "" DBUS_SESSION_SRV_DIR "${DBUS_SESSION_SRV_DIR}")
25 include_directories (${CMAKE_SOURCE_DIR}
26 ${CMAKE_CURRENT_BINARY_DIR}
29 ${KFI_POLKIT_INCLUDES} )
31 set(kio_fonts_helper_SRCS FontInst.cpp PolicyKitMechanism.cpp ${libkxftconfig_SRCS})
33 # qdbuscpp2xml -M -S FontInst.h -o org.kde.fontinst.xml
35 qt4_add_dbus_adaptor(kio_fonts_helper_SRCS org.kde.fontinst.xml FontInst.h FontInst)
37 kde4_add_executable(kio_fonts_helper_bin ${kio_fonts_helper_SRCS})
38 set_target_properties(kio_fonts_helper_bin PROPERTIES OUTPUT_NAME kio_fonts_helper)
40 target_link_libraries(kio_fonts_helper_bin ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} kfontinst ${KFI_POLKIT_LIBS})
41 install(TARGETS kio_fonts_helper_bin DESTINATION ${LIBEXEC_INSTALL_DIR})
43 configure_file(org.kde.fontinst.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.fontinst.service @ONLY)
45 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.fontinst.service
46 DESTINATION ${DBUS_SESSION_SRV_DIR}/../system-services/)
47 install(FILES org.kde.fontinst.conf
48 DESTINATION ${DBUS_SYSCONF_DIR}/dbus-1/system.d/)
49 install(FILES org.kde.fontinst.policy
50 DESTINATION ${POLICY_DIR})
52 else (KFI_USE_POLICY_KIT AND POLKITDBUS_FOUND)
54 set(kio_fonts_PART_SRCS KioFonts.cpp Server.cpp Socket.cpp SuProc.cpp ${libkxftconfig_SRCS})
55 set(kio_fonts_helper_SRCS Helper.cpp Socket.cpp ${libkxftconfig_SRCS})
56 kde4_add_executable(kio_fonts_helper ${kio_fonts_helper_SRCS} )
57 target_link_libraries(kio_fonts_helper ${KDE4_KDECORE_LIBS} ${QT_QTXML_LIBRARY} ${QT_QTNETWORK_LIBRARY}
58 ${QT_QTGUI_LIBRARY} ${FONTCONFIG_LIBRARIES} kfontinst )
59 install(TARGETS kio_fonts_helper DESTINATION ${LIBEXEC_INSTALL_DIR} )
61 endif (KFI_USE_POLICY_KIT AND POLKITDBUS_FOUND)
63 kde4_add_plugin(kio_fonts ${kio_fonts_PART_SRCS} ${KFI_FONTINST_AUTH_SRC} )
64 target_link_libraries(kio_fonts ${KDE4_KIO_LIBS} ${KDE4_KDESU_LIBS} ${QT_QTNETWORK_LIBRARY} ${FONTCONFIG_LIBRARIES} ${FREETYPE_LIBRARIES} kfontinst )
65 install(TARGETS kio_fonts DESTINATION ${PLUGIN_INSTALL_DIR} )
67 install( FILES fonts.desktop DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/virtual_folders/services )
68 install( FILES fonts.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
69 kde4_install_icons( ${ICON_INSTALL_DIR} )