#***************************************************************************
#*   Copyright (C) 2008 by S. MANKOWSKI / G. DE BURE support@mankowski.fr  *
#*                                                                         *
#*   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, see <http://www.gnu.org/licenses/>  *
#***************************************************************************
MESSAGE( STATUS "..:: CMAKE SKGBANKGUI ::..")

PROJECT(SKGBANKGUI)

INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR} ${KDE4_INCLUDES} ${QT_INCLUDES}
${CMAKE_SOURCE_DIR}/skgbasemodeler ${CMAKE_SOURCE_DIR}/skgbasegui ${CMAKE_SOURCE_DIR}/skgbankmodeler
${CMAKE_BINARY_DIR}/skgbasegui
)
LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})

SET(skgbankgui_SRCS
   skgobjectmodel.cpp
   skgquerycreator.cpp
   skgpredicatcreator.cpp
   skgquerydelegate.cpp
   skgunitcombobox.cpp
 )
 
SET(skgbankgui_designer_SRCS
   skgquerycreatordesignerplugin.cpp
   skgbkwidgetcollectiondesignerplugin.cpp
   skgpredicatcreatordesignerplugin.cpp
   skgunitcomboboxdesignerplugin.cpp
 ) 

kde4_add_ui_files(skgbankgui_SRCS skgquerycreator.ui)

KDE4_ADD_LIBRARY(skgbankgui SHARED ${skgbankgui_SRCS})
KDE4_ADD_LIBRARY(skgbankguidesigner SHARED ${skgbankgui_designer_SRCS})

TARGET_LINK_LIBRARIES(skgbankgui ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} skgbankmodeler skgbasemodeler skgbasegui)
SET_TARGET_PROPERTIES( skgbankgui PROPERTIES VERSION ${SKG_VERSION} SOVERSION ${SOVERSION} )

TARGET_LINK_LIBRARIES(skgbankguidesigner ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} skgbankmodeler skgbasemodeler skgbasegui skgbankgui)

########### install files ###############
INSTALL(TARGETS skgbankgui ${INSTALL_TARGETS_DEFAULT_ARGS}  )
IF(SKG_BUILD_TEST)
  IF(WIN32)
    INSTALL(TARGETS skgbankguidesigner LIBRARY ARCHIVE DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer )
  ELSE(WIN32)
    INSTALL(TARGETS skgbankguidesigner LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer )
  ENDIF(WIN32)
ENDIF(SKG_BUILD_TEST)  
kde4_install_icons(${ICON_INSTALL_DIR})
