not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / krunner / CMakeLists.txt
blobde480f0b6026324aef2783a01341fef96fa058e2
1 #KDE4_NO_ENABLE_FINAL(krunner)
2 add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1207)
4 include(UsePkgConfig)
6 MACRO(PKGCONFIG_GETVAR _package _var _output_variable)
7    SET(${_output_variable})
9    # if pkg-config has been found
10    IF(PKGCONFIG_EXECUTABLE)
11       EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
12       # and if the package of interest also exists for pkg-config, then get the information
13       IF(NOT _return_VALUE)
14          EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable ${_var} OUTPUT_VARIABLE ${_output_variable} )
15       ENDIF(NOT _return_VALUE)
16    ENDIF(PKGCONFIG_EXECUTABLE)
17 ENDMACRO(PKGCONFIG_GETVAR _package _var _output_variable)
19 macro(dbus_add_activation_service _sources)
20    #PKGCONFIG_GETVAR(dbus-1 session_bus_services_dir _install_dir)
21    foreach (_i ${_sources})
22       get_filename_component(_service_file ${_i} ABSOLUTE)
23       string(REGEX REPLACE "\\.service.*$" ".service" _output_file ${_i})
24       set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_output_file})
25       configure_file(${_service_file} ${_target})
26       install(FILES ${_target} DESTINATION ${DBUS_SERVICES_INSTALL_DIR} )#${_install_dir})
27    endforeach (_i ${ARGN})
28 endmacro(dbus_add_activation_service _sources)
30 include_directories(${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/ksysguard
31                     ${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/ksysguard/processcore/
32                     ${KDEBASE_WORKSPACE_SOURCE_DIR}/krunner/screensaver)
34 configure_file(config-xautolock.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-xautolock.h)
36 set(krunner_KCFG_SRCS kcfg/krunnersettings.kcfgc kcfg/kscreensaversettings.kcfgc kcfg/klaunchsettings.kcfgc)
37 set(krunner_dbusAppXML dbus/org.kde.krunner.App.xml)
38 set(screensaver_dbusXML dbus/org.freedesktop.ScreenSaver.xml)
39 set(kscreensaver_dbusXML dbus/org.kde.screensaver.xml)
41 set(default_interface_SRCS
42    interfaces/default/resultitem.cpp
43    interfaces/default/resultscene.cpp
44    interfaces/default/interface.cpp)
46 set(quicksand_interface_SRCS
47    interfaces/quicksand/qs_completionbox.cpp
48    interfaces/quicksand/qs_dialog.cpp
49    interfaces/quicksand/qs_matchitem.cpp
50    interfaces/quicksand/qs_matchview.cpp
51    interfaces/quicksand/qs_queryactionitem.cpp
52    interfaces/quicksand/qs_querymatchitem.cpp
53    interfaces/quicksand/qs_statusbar.cpp)
55 set(krunner_SRCS
56    krunnerdialog.cpp
57    configdialog.cpp
58    krunnerapp.cpp
59    main.cpp
60    ${default_interface_SRCS}
61    ${quicksand_interface_SRCS})
63 kde4_add_kcfg_files(krunner_SRCS ${krunner_KCFG_SRCS})
65 qt4_add_dbus_adaptor(krunner_SRCS ${krunner_dbusAppXML} krunnerapp.h KRunnerApp)
66 dbus_add_activation_service(dbus/org.kde.krunner.service.in)
68 if(NOT WIN32)
69 set(krunner_SRCS
70     ${krunner_SRCS}
71     startupid.cpp
72     screensaver/saverengine.cpp
73     screensaver/xautolock.cpp
74     screensaver/xautolock_diy.c
75     screensaver/xautolock_engine.c)
77 qt4_add_dbus_adaptor(krunner_SRCS ${screensaver_dbusXML} saverengine.h SaverEngine)
78 qt4_add_dbus_adaptor(krunner_SRCS ${kscreensaver_dbusXML} saverengine.h SaverEngine kscreensaveradaptor KScreenSaverAdaptor)
79 endif(NOT WIN32)
81 kde4_add_kdeinit_executable(krunner ${krunner_SRCS})
83 if(NOT WIN32)
84 target_link_libraries(kdeinit_krunner kworkspace processui ${KDE4_PLASMA_LIBS} ${KDE4_SOLID_LIBRARIES} ${KDE4_THREADWEAVER_LIBRARIES} ${X11_Xrender_LIB} ${KDE4_KDEUI_LIBS}  ${KDE4_KUTILS_LIBS} ${X11_LIBRARIES})
85 else(NOT WIN32)
86 target_link_libraries(kdeinit_krunner ${KDE4_PLASMA_LIBS} ${KDE4_SOLID_LIBRARIES} ${KDE4_THREADWEAVER_LIBRARIES} ${KDE4_KDEUI_LIBS}  ${KDE4_KUTILS_LIBS})
87 endif(NOT WIN32)
89 if(X11_Xss_LIB)
90   target_link_libraries(kdeinit_krunner ${X11_Xss_LIB})
91 endif(X11_Xss_LIB)
93 if(X11_Xcursor_FOUND)
94   target_link_libraries(kdeinit_krunner ${X11_Xcursor_LIB})
95 endif(X11_Xcursor_FOUND)
97 if(NOT WIN32)
98 add_subdirectory( lock )
99 endif(NOT WIN32)
101 install(TARGETS kdeinit_krunner ${INSTALL_TARGETS_DEFAULT_ARGS} )
102 install(TARGETS krunner         ${INSTALL_TARGETS_DEFAULT_ARGS} )
104 install(FILES krunner.desktop  DESTINATION  ${AUTOSTART_INSTALL_DIR})
105 install(FILES kcfg/kscreensaversettings.kcfg  DESTINATION  ${KCFG_INSTALL_DIR})
106 install(FILES kcfg/klaunch.kcfg  DESTINATION  ${KCFG_INSTALL_DIR})
107 install(FILES ${krunner_dbusAppXML} ${screensaver_dbusXML} ${kscreensaver_dbusXML} DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )