# Copyright(C) 2007 Stefan Siegl <stesie@brokenpipe.de>
#
# kopete_silc - silc plugin for kopete messenger
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# configure installation paths
set(SHARE_INSTALL_PREFIX 
  ${CMAKE_INSTALL_PREFIX}/share 
  CACHE PATH "Base directory for files which go to share/" FORCE)
set(DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" 
    CACHE PATH "The parent directory where applications can install their data" FORCE)
set(ICON_INSTALL_DIR "${DATA_INSTALL_DIR}/kopete/icons/crystalsvg"
    CACHE PATH "The parent directory where the Kopete icons shall be installed to" FORCE)  


set(kopete_silc_ICONS
  cr16-action-silc_away.png
  cr16-action-silc_busy.png
  cr16-action-silc_channel.png
  cr16-action-silc_detached.png
  cr16-action-silc_hyper.png
  cr16-action-silc_indisposed.png
  cr16-action-silc_mute.png
  cr16-action-silc_op.png
  cr32-app-silc_protocol.png
)

FOREACH (_current_ICON ${kopete_silc_ICONS} )
  STRING(REGEX REPLACE "^[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size  "${_current_ICON}")
  STRING(REGEX REPLACE "^[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
  STRING(REGEX REPLACE "^[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name  "${_current_ICON}")

  #MESSAGE("handling icon: ${_current_ICON} -> ${_size}x${_size}/${_group}/${_name}")
  INSTALL(FILES ${_current_ICON} DESTINATION ${ICON_INSTALL_DIR}/${_size}x${_size}/${_group}s/ RENAME ${_name})
ENDFOREACH (_current_ICON)

