#*******************************************************************************
#**  This file is part of Dux Rei Nummariae.                                 ***
#**                                                                          ***
#**  Copyright (C) 2017, 2018, 2019, 2020, 2021                              ***
#**  John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me>                ***
#**                                                                          ***
#**  This program is free software: you can redistribute it and/or modify it ***
#**  under the terms of the GNU Affero General Public License as published   ***
#**  by the Free Software Foundation, either version 3 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 Affero General Public License for more details.             ***
#**                                                                          ***
#**  You should have received a copy of the GNU Affero General Public License***
#**  along with this program. If not, see <http://www.gnu.org/licenses/>.    ***
#*******************************************************************************
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(desktop-ui
	VERSION ${DuxReiNummariae_VERSION}
	DESCRIPTION "Library for the user interface on the desktop."
	LANGUAGES CXX
)

# Needed for the Auto Qt to work.
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt5 REQUIRED COMPONENTS Core Widgets)

set(${PROJECT_NAME}_PUBLIC_DECLARATIONS
	external/${PROJECT_NAME}/CurrencyCodeWidget.h
	external/${PROJECT_NAME}/DesktopUiErrors.h
	external/${PROJECT_NAME}/EventFrequencyEntryWidget.h
	external/${PROJECT_NAME}/MainWindow.h
	external/${PROJECT_NAME}/MoneyEntryWidget.h
	external/${PROJECT_NAME}/VerticalLabel.h
)
set(${PROJECT_NAME}_PUBLIC_DEFINITIONS
	external/${PROJECT_NAME}/CurrencyCodeWidget.cpp
	external/${PROJECT_NAME}/DesktopUiErrors.cpp
	external/${PROJECT_NAME}/EventFrequencyEntryWidget.cpp
	external/${PROJECT_NAME}/MainWindow.cpp
	external/${PROJECT_NAME}/MoneyEntryWidget.cpp
	external/${PROJECT_NAME}/VerticalLabel.cpp
)
set(${PROJECT_NAME}_PRIVATE_DECLARATIONS
	internal/AccountsWidget.h
	internal/AccountEntryWidget.h
	internal/BankAccountsWidget.h
	internal/BankEntryWidget.h
	internal/BanksWidget.h
	internal/BillEntryWidget.h
	internal/BillsWidget.h
	internal/BudgetHealthWidget.h
	internal/BudgetItemsDueWidget.h
	internal/ConfigureDialog.h
	internal/DashboardWidget.h
	internal/DebtEntryWidget.h
	internal/DebtsWidget.h
	internal/DisableSignalsTemporarily.hpp
	internal/ExchangeRatesDialog.h
	internal/GoalEntryWidget.h
	internal/GoalsWidget.h
	internal/LedgersWidget.h
	internal/MonthlyTotalsWidget.h
	internal/NontrackEntryWidget.h
	internal/NontracksWidget.h
	internal/PostBudgetItemEntryWidget.h
	internal/PostBudgetItemsWidget.h
	internal/TransactionWidget.h
	internal/WageEntryWidget.h
	internal/WagesWidget.h
	internal/WidgetObserverMap.hpp
)
set(${PROJECT_NAME}_PRIVATE_DEFINITIONS
	internal/AccountsWidget.cpp
	internal/AccountEntryWidget.cpp
	internal/BankAccountsWidget.cpp
	internal/BankEntryWidget.cpp
	internal/BanksWidget.cpp
	internal/BillEntryWidget.cpp
	internal/BillsWidget.cpp
	internal/BudgetHealthWidget.cpp
	internal/BudgetItemsDueWidget.cpp
	internal/ConfigureDialog.cpp
	internal/DashboardWidget.cpp
	internal/DebtEntryWidget.cpp
	internal/DebtsWidget.cpp
	internal/DisableSignalsTemporarily.hpp
	internal/ExchangeRatesDialog.cpp
	internal/GoalEntryWidget.cpp
	internal/GoalsWidget.cpp
	internal/LedgersWidget.cpp
	internal/MonthlyTotalsWidget.cpp
	internal/NontrackEntryWidget.cpp
	internal/NontracksWidget.cpp
	internal/PostBudgetItemEntryWidget.cpp
	internal/PostBudgetItemsWidget.cpp
	internal/TransactionWidget.cpp
	internal/WageEntryWidget.cpp
	internal/WagesWidget.cpp
	internal/WidgetObserverMap.hpp
)

setUpProject(DynamicLibrary)

target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets)

target_link_libraries(${PROJECT_NAME} PUBLIC adviser)
target_link_libraries(${PROJECT_NAME} PUBLIC budgeting)
target_link_libraries(${PROJECT_NAME} PUBLIC conversion)
target_link_libraries(${PROJECT_NAME} PUBLIC foundation)
target_link_libraries(${PROJECT_NAME} PUBLIC file-storage)
target_link_libraries(${PROJECT_NAME} PUBLIC navigation)
