not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / scriptengines / google_gadgets / CMakeLists.txt
blobe34a2df10cc0c00f009907f68942f58306137ead
1 project(plasma-ggl)
3 add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
4 add_definitions (${GOOGLEGADGETS_CFLAGS_OTHER})
6 include_directories(
7    ${GOOGLEGADGETS_INCLUDE_DIRS}
8    )
10 execute_process(COMMAND pkg-config --variable=ggl_resource_dir libggadget-1.0
11     OUTPUT_VARIABLE gadgets_path)
12 string(REPLACE "\n" "" "gadgets_path" "${gadgets_path}")
14 macro(install_ggl_gadget _name)
15   find_file(${_name}_path ${_name}.gg ${gadgets_path})
16   if (NOT ${${_name}_path} MATCHES "NOTFOUND")
17     set(gadget_name "ggl_${_name}")
18     set(gadget_readable_name ${_name})
19     set(gadget_comment ${_name})
20     set(gadget_path "${${_name}_path}")
21     set(gadget_options_name "${_name}_builtin")
22     configure_file(plasma-applet-ggl.desktop.tmpl
23       ${CMAKE_CURRENT_BINARY_DIR}/plasma-applet-ggl-${_name}.desktop
24       @only)
25     configure_file(config.txt.tmpl
26       ${CMAKE_CURRENT_BINARY_DIR}/config.txt.${_name}
27       @only)
28     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma-applet-ggl-${_name}.desktop
29       DESTINATION ${SERVICES_INSTALL_DIR})
30     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.txt.${_name}
31       DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/${gadget_name}
32       RENAME config.txt)
33   endif (NOT ${${_name}_path} MATCHES "NOTFOUND")
34 endmacro(install_ggl_gadget _name)
36 # We add our source code here
37 set(package_SRCS ggl_package.cpp)
38 set(scriptengine_SRCS
39   ggl_applet_script.cpp
40   plasma_host.cpp
41   plasma_view_host.cpp
42   panel_decorator.cpp
43   floating_decorator.cpp
44   )
46 # Now make sure all files get to the right place
47 kde4_add_plugin(plasma_package_ggl ${package_SRCS})
48 target_link_libraries(plasma_package_ggl
49   ${GOOGLEGADGETS_LIBRARIES}
50   plasma ${KDE4_KDECORE_LIBS} )
52 kde4_add_plugin(plasma_scriptengine_ggl ${scriptengine_SRCS})
53 target_link_libraries(plasma_scriptengine_ggl
54   ${GOOGLEGADGETS_LIBRARIES}
55   plasma ${KDE4_KDEUI_LIBS} )
57 install(TARGETS plasma_package_ggl DESTINATION ${PLUGIN_INSTALL_DIR})
58 install(FILES plasma-packagestructure-googlegadgets.desktop DESTINATION ${SERVICES_INSTALL_DIR})
59 install(TARGETS plasma_scriptengine_ggl DESTINATION ${PLUGIN_INSTALL_DIR})
60 install(FILES plasma-scriptengine-googlegadgets.desktop DESTINATION ${SERVICES_INSTALL_DIR})
62 install_ggl_gadget(photos)
63 install_ggl_gadget(rss)
64 install_ggl_gadget(analog_clock)
65 install_ggl_gadget(weather_globe)