# Copyright (C) 2020 Uniontech Technology Co., Ltd.
#
# Author:     xinbo wang <wangxinbo@uniontech.com>
#
# Maintainer: xinbo wang <wangxinbo@uniontech.com>
#
# 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 3 of the License, or
# 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/>.

cmake_minimum_required(VERSION 3.13)

set(PROJECT_NAME "CopySecurityTest")

set(VERSION "1.0.0" CACHE STRING "define project version")

project(${PROJECT_NAME}
    HOMEPAGE_URL https://github.com/linuxdeepin/dtk-template
    DESCRIPTION "dtk display module"
    VERSION ${VERSION}
)

set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall")

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

include_directories(../../include/clipboard-ace/)

# Find the library
find_package(PkgConfig REQUIRED)
find_package(Qt5 COMPONENTS
    Core
    Gui
    Widgets
    REQUIRED)

find_package(dtkclipboardace REQUIRED)

if(dtkclipboardace_FOUND)
    MESSAGE(STATUS "DTKDISPLAY_FOUND = ${dtkclipboardace_FOUND}.")
else()
    MESSAGE(STATUS "DTKDISPLAY_FOUND not found.")
endif()

FILE(GLOB SC_FILES "*.cpp" "*.h")
FILE(GLOB UI_FILES "./*.ui")

add_executable(${PROJECT_NAME} ${SC_FILES} ${RCC_FILES})

target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} dtkclipboardace)
