
add_subdirectory( hicolor )
add_subdirectory( crystalsvg )
add_subdirectory( emoticons )

include_directories( ${KDE4_KDECORE_INCLUDES} )
include_directories( ${CMAKE_SOURCE_DIR}/kdecore/svgicons ${CMAKE_SOURCE_DIR}/kdefx )

# you can find macro_optional_find_package() in kdelibs/cmake/modules/OptionalFindPackage.cmake
# it is the same as FIND_PACKAGE(<name>) but additionally creates an OPTION(WITH_<name>)
# so the checking for the software can be disabled via ccmake or -DWITH_<name>=OFF
macro_optional_find_package(AGG)
set(ksvgtopng_SRCS ksvgtopng.cpp )
kde4_automoc(${ksvgtopng_SRCS})
kde4_add_executable(ksvgtopng NOGUI ${ksvgtopng_SRCS})
target_link_libraries(ksvgtopng ${KDE4_KDECORE_LIBS} )
install(TARGETS ksvgtopng DESTINATION ${BIN_INSTALL_DIR} )

########### next target ###############

#set($(KSVGTOPNG)_SRCS
#dummy.cpp
#)

#kde4_automoc(${$(KSVGTOPNG)_SRCS})

#kde4_add_executable($(KSVGTOPNG) ${$(KSVGTOPNG)_SRCS})

#target_link_libraries($(KSVGTOPNG)  ${KDE4_KDECORE_LIBS} )

#install(TARGETS $(KSVGTOPNG) DESTINATION ${BIN_INSTALL_DIR} )


########### install files ###############

#if (UNIX)
   # write a cmake script file which creates the symlink
#   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_icontheme_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink crystalsvg ${ICON_INSTALL_DIR}/default.kde\n")
   # and add it as post-install script to any of the installed targets, so it will be executed during "make install"
#   set_target_properties(kio_uiserver PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_icontheme_symlink.cmake)
#endif (UNIX)
# TODO: INSTALL( SCRIPT .... )




