Allow to optionally build korgac as an Akonadi agent that runs inside
[kdepim.git] / korganizer / korgac / CMakeLists.txt
blobe8c314483dbef98640edfc1ebd60445484a9242c
1 remove_definitions(-DKDE_DEFAULT_DEBUG_AREA=5850) #remove korganizer debug area
2 add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5890)
4 option(KORGAC_AKONADI_AGENT FALSE "Build Korgac as Akonadi agent instead of a stand-alone process")
5 if (KORGAC_AKONADI_AGENT)
6   add_definitions( -DKORGAC_AKONADI_AGENT )
7 endif ()
9 add_subdirectory(pixmaps) 
10 add_subdirectory(tests) 
11 include_directories(
12  ${CMAKE_SOURCE_DIR}/korganizer
13  ${CMAKE_BINARY_DIR}/korganizer )
16 ########### next target ###############
18 set(korgac_SRCS 
19    koalarmclient.cpp)
21 if(KORGAC_AKONADI_AGENT)
22   set(korgac_SRCS ${korgac_SRCS} korgacagent.cpp)
23 else()
24   set(korgac_SRCS ${korgac_SRCS} korgacmain.cpp)
25 endif()
27 if(NOT WINCE)   
28 set(korgac_SRCS
29    ${korgac_SRCS}
30    alarmdialog.cpp 
31    alarmdockwindow.cpp 
33 endif(NOT WINCE)
35 set(korganizer_xml ${CMAKE_SOURCE_DIR}/korganizer/org.kde.korganizer.Korganizer.xml)
36 QT4_ADD_DBUS_INTERFACE(korgac_SRCS ${korganizer_xml} korganizer_interface)
40 qt4_add_dbus_adaptor(korgac_SRCS org.kde.korganizer.KOrgac.xml koalarmclient.h KOAlarmClient)
42 if (RUNTIME_PLUGINS_STATIC)
43   add_definitions(-DSERIALIZER_PLUGIN_STATIC)
44 endif (RUNTIME_PLUGINS_STATIC)
46 kde4_add_app_icon(korgac_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/korgac.png")
48 if(KORGAC_AKONADI_AGENT)
49   if(NOT WINCE)
50     kde4_add_plugin(korgac ${korgac_SRCS})
51   else()
52     kde4_add_plugin(korgac STATIC ${korgac_SRCS})
53   endif()
54 else()
55   kde4_add_executable(korgac ${korgac_SRCS})
56 endif()
58 target_link_libraries(korgac
59   calendarsupport
60   ${KDE4_KDEUI_LIBS} 
61   ${KDE4_PHONON_LIBS} 
62   ${KDEPIMLIBS_KPIMIDENTITIES_LIBS}
63   ${KDEPIMLIBS_AKONADI_LIBS}
64   ${KDEPIMLIBS_MAILTRANSPORT_LIBS}
65   ${KDEPIMLIBS_KCALCORE_LIBS} 
66   ${KDEPIMLIBS_KCALUTILS_LIBS} 
67   kdepim
68   kdepimdbusinterfaces
71 if (RUNTIME_PLUGINS_STATIC)
72   target_link_libraries(korgac akonadi_serializer_kcalcore )
73 endif (RUNTIME_PLUGINS_STATIC)
75 if(NOT WINCE)
76 target_link_libraries(korgac korganizer_core)
77 endif(NOT WINCE)
79 # TODO: move this to FindQt4.cmake
80 find_library( QT_QMAEMO5_LIBRARY QtMaemo5 HINTS ${QT_LIBRARY_DIR} )
81 if ( QT_QMAEMO5_LIBRARY )
82   target_link_libraries( korgac ${QT_QMAEMO5_LIBRARY} )
83 endif ()
85 if(KORGAC_AKONADI_AGENT)
86   install(TARGETS korgac DESTINATION ${PLUGIN_INSTALL_DIR})
87   install(FILES korgacagent.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/akonadi/agents)
88 else()
89   install(TARGETS korgac ${INSTALL_TARGETS_DEFAULT_ARGS})
90 endif()
93 ########### install files ###############
95 install(PROGRAMS korgac.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
96 install(FILES org.kde.korganizer.KOrgac.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})