#***************************************************************************
#*   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)

LINK_DIRECTORIES (${LIBRARY_OUTPUT_PATH})

SET(skgbankgui_SRCS
    skgobjectmodel.cpp
    skgquerycreator.cpp
    skgpredicatcreator.cpp
    skgquerydelegate.cpp
    skgunitcombobox.cpp
)

SET(LIBS Qt5::Xml skgbankmodeler skgbasemodeler skgbasegui)
IF(SKG_WEBENGINE)
    SET(LIBS ${LIBS} Qt5::WebEngineWidgets)
ELSE(SKG_WEBENGINE)
    SET(LIBS ${LIBS} Qt5::WebKitWidgets)
ENDIF(SKG_WEBENGINE)
IF(KActivities_FOUND)
    MESSAGE( STATUS "     KActivity FOUND" )
    SET(LIBS ${LIBS} KF5::Activities)
endif (KActivities_FOUND)

ki18n_wrap_ui(skgbankgui_SRCS skgquerycreator.ui)

ADD_LIBRARY(skgbankgui SHARED ${skgbankgui_SRCS})
TARGET_LINK_LIBRARIES(skgbankgui LINK_PUBLIC ${LIBS})
SET_TARGET_PROPERTIES(skgbankgui PROPERTIES VERSION ${SKG_VERSION} SOVERSION ${SOVERSION} )
GENERATE_EXPORT_HEADER(skgbankgui BASE_NAME skgbankgui)

########### install files ###############
INSTALL(TARGETS skgbankgui ${INSTALL_TARGETS_DEFAULT_ARGS}  LIBRARY NAMELINK_SKIP  )
INSTALL(DIRECTORY icons_breeze/ DESTINATION ${ICON_INSTALL_DIR}/breeze/actions/22 FILES_MATCHING PATTERN "*.svgz")
INSTALL(DIRECTORY icons_breeze-dark/ DESTINATION ${ICON_INSTALL_DIR}/breeze-dark/actions/22 FILES_MATCHING PATTERN "*.svgz")

ECM_INSTALL_ICONS(ICONS
    icons_hicolor/16-actions-skrooge_credit_card.png
    icons_hicolor/16-actions-skrooge_less.png
    icons_hicolor/16-actions-skrooge_more.png
    icons_hicolor/16-actions-skrooge_much_less.png
    icons_hicolor/16-actions-skrooge_much_more.png
    icons_hicolor/16-actions-skrooge_type.png
    icons_hicolor/22-actions-skrooge_credit_card.png
    icons_hicolor/22-actions-skrooge_less.png
    icons_hicolor/22-actions-skrooge_more.png
    icons_hicolor/22-actions-skrooge_much_less.png
    icons_hicolor/22-actions-skrooge_much_more.png
    icons_hicolor/22-actions-skrooge_type.png
    icons_hicolor/32-actions-skrooge_credit_card.png
    icons_hicolor/32-actions-skrooge_less.png
    icons_hicolor/32-actions-skrooge_more.png
    icons_hicolor/32-actions-skrooge_much_less.png
    icons_hicolor/32-actions-skrooge_much_more.png
    icons_hicolor/32-actions-skrooge_type.png
    icons_hicolor/48-actions-skrooge_credit_card.png
    icons_hicolor/48-actions-skrooge_less.png
    icons_hicolor/48-actions-skrooge_more.png
    icons_hicolor/48-actions-skrooge_much_less.png
    icons_hicolor/48-actions-skrooge_much_more.png
    icons_hicolor/48-actions-skrooge_type.png
    icons_hicolor/64-actions-skrooge_credit_card.png
    icons_hicolor/64-actions-skrooge_less.png
    icons_hicolor/64-actions-skrooge_more.png
    icons_hicolor/64-actions-skrooge_much_less.png
    icons_hicolor/64-actions-skrooge_much_more.png
    icons_hicolor/64-actions-skrooge_type.png
    icons_hicolor/128-actions-skrooge_credit_card.png
    icons_hicolor/128-actions-skrooge_less.png
    icons_hicolor/128-actions-skrooge_more.png
    icons_hicolor/128-actions-skrooge_much_less.png
    icons_hicolor/128-actions-skrooge_much_more.png
    icons_hicolor/128-actions-skrooge_type.png
    icons_hicolor/256-actions-skrooge_credit_card.png
    icons_hicolor/256-actions-skrooge_less.png
    icons_hicolor/256-actions-skrooge_more.png
    icons_hicolor/256-actions-skrooge_much_less.png
    icons_hicolor/256-actions-skrooge_much_more.png
    icons_hicolor/256-actions-skrooge_type.png
    icons_hicolor/512-actions-skrooge_credit_card.png
    icons_hicolor/512-actions-skrooge_less.png
    icons_hicolor/512-actions-skrooge_more.png
    icons_hicolor/512-actions-skrooge_much_less.png
    icons_hicolor/512-actions-skrooge_much_more.png
    icons_hicolor/512-actions-skrooge_type.png 
    icons_hicolor/sc-actions-skrooge_credit_card.svgz
    icons_hicolor/sc-actions-skrooge_less.svgz
    icons_hicolor/sc-actions-skrooge_more.svgz
    icons_hicolor/sc-actions-skrooge_much_less.svgz
    icons_hicolor/sc-actions-skrooge_much_more.svgz
    icons_hicolor/sc-actions-skrooge_type.svgz
    DESTINATION ${ICON_INSTALL_DIR}
    THEME hicolor
)
