3 SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules" )
6 # search packages used by KDE
7 find_package (KDE4 REQUIRED)
10 include(MacroOptionalAddSubdirectory)
11 include(CheckIncludeFiles)
12 include(FindKdepimLibs)
14 #libgcal implements google data protocols 2.0
15 FIND_PACKAGE( LibGcal REQUIRED )
18 find_program(XSLTPROC_EXECUTABLE xsltproc)
19 macro_log_feature(XSLTPROC_EXECUTABLE "xsltproc" "The command line XSLT processor from libxslt" "http://xmlsoft.org/XSLT/" FALSE "" "Needed for building Akonadi resources. Recommended.")
21 if (XSLTPROC_EXECUTABLE)
22 # generates a D-Bus interface description from a KConfigXT file
23 macro( kcfg_generate_dbus_interface _kcfg _name )
25 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml
26 COMMAND ${XSLTPROC_EXECUTABLE} --stringparam interfaceName ${_name}
27 ${KDE4_DATA_DIR}/akonadi-kde/kcfg2dbus.xsl
29 > ${CMAKE_CURRENT_BINARY_DIR}/${_name}.xml
30 DEPENDS ${KDE4_DATA_DIR}/akonadi-kde/kcfg2dbus.xsl
33 endmacro( kcfg_generate_dbus_interface )
34 endif (XSLTPROC_EXECUTABLE)
37 set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}
38 RUNTIME DESTINATION ${BIN_INSTALL_DIR}
39 LIBRARY DESTINATION ${LIB_INSTALL_DIR}
40 ARCHIVE DESTINATION ${LIB_INSTALL_DIR} )
43 set(KDE4_ICON_DIR ${KDE4_INSTALL_DIR}/share/icons)
46 ${KDE4_INCLUDES} ${LIBGCAL_INCLUDE_DIRS}
49 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" )
52 ########### next target ###############
54 set( googledataresource_SRCS
55 googledataresource.cpp
59 kde4_add_ui_files( googledataresource_SRCS GoogleData.ui )
60 install( FILES googledataresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
62 kde4_add_kcfg_files(googledataresource_SRCS settings.kcfgc)
63 kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/googledataresource.kcfg org.kde.Akonadi.googledata.Settings)
64 qt4_add_dbus_adaptor(googledataresource_SRCS
65 ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.googledata.Settings.xml settings.h Settings
68 kde4_add_executable(akonadi_googledata_resource RUN_UNINSTALLED ${googledataresource_SRCS})
70 target_link_libraries(akonadi_googledata_resource ${KDE4_AKONADI_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KABC_LIBS} ${LIBGCAL_LIBRARIES})
72 install(TARGETS akonadi_googledata_resource ${INSTALL_TARGETS_DEFAULT_ARGS})