#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

file( GLOB _admin_content RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} admin/* )
list(
  REMOVE_ITEM _admin_content admin/.git
  admin/config.guess.cdbs-orig admin/config.sub.cdbs-orig
)

file( GLOB _incadmin_content RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/incadmin incadmin/* )
list( REMOVE_ITEM _incadmin_content config.guess.cdbs-orig config.sub.cdbs-orig )

tde_create_tarball( TARGET admin.tar.gz FILES ${_admin_content} )
tde_create_tarball( TARGET gnome.tar.gz SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/gnome )
tde_create_tarball( TARGET gnome2.tar.gz SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/gnome2 )
tde_create_tarball( TARGET gnu.tar.gz SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/gnu )
tde_create_tarball( TARGET wxwidgets.tar.gz SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/wx )
tde_create_tarball(
  TARGET incadmin.tar.gz
  SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/incadmin
  FILES ${_incadmin_content}
)
tde_create_tarball( TARGET scons.tar.gz SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/scons )

install( FILES
    ${CMAKE_CURRENT_BINARY_DIR}/admin.tar.gz
    ${CMAKE_CURRENT_BINARY_DIR}/gnu.tar.gz
    ${CMAKE_CURRENT_BINARY_DIR}/incadmin.tar.gz
    ${CMAKE_CURRENT_BINARY_DIR}/gnome.tar.gz
    ${CMAKE_CURRENT_BINARY_DIR}/gnome2.tar.gz
    ${CMAKE_CURRENT_BINARY_DIR}/wxwidgets.tar.gz
    kde-Makefile.am kde-Makefile.cvs
    tde-configure.in.in tde-index.docbook
    kde-po-Makefile.am kde-doc-Makefile.am
    kde-doc-en-Makefile.am hi16-app-app.png
    hi32-app-app.png
    gnome-Makefile.am gnome-Makefile.cvs
    gnome-pixmaps-Makefile.am gnome-app.png
    wx-configure.in wx-Makefile.am wx-Makefile.cvs
    COPYING COPYING.LIB LICENSE.QPL LICENSE.BSD
    Artistic
    ${CMAKE_CURRENT_BINARY_DIR}/scons.tar.gz
  DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template-common )

tde_create_translated_desktop(
  SOURCE
    tde-app.desktop tde-part.desktop
    admin.kdevtemplate gnu.kdevtemplate
    dockbook.kdevtemplate incadmin.kdevtemplate
    gnome2.kdevtemplate scons.kdevtemplate
  DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template-common
  PO_DIR tdevelop-desktops
)
