#-----------------------------------------------------------------------------
#
# Copyright (C) 2022 Bjarne von Horn <vh@igh.de>
#
# This file is part of the QtPdWidgets library.
#
# The QtPdWidgets library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# The QtPdWidgets library 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 Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the QtPdWidgets Library. If not, see
# <http://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.10)

project(pdwidgetsexample)

# load Qt
find_package(Qt5 REQUIRED COMPONENTS Gui Network Quick Svg Widgets Xml)
# load PdWidgets
if (NOT TARGET EtherLab::QtPdWidgets2)
    find_package(QtPdWidgets2 REQUIRED)
endif()

add_executable(${PROJECT_NAME}
    MainWindow.ui
    MainWindow.h
    MainWindow.cpp
    main.cpp

    example.qrc
)

# enable moc, uic and rcc
set_target_properties(${PROJECT_NAME} PROPERTIES
    AUTOUIC 1
    AUTOMOC 1
    AUTORCC 1
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)

# link against Qt and PdWidgets
target_link_libraries(${PROJECT_NAME} PUBLIC
    EtherLab::QtPdWidgets2
    Qt5::Gui
    Qt5::Widgets
)
