cmake_minimum_required(VERSION 3.16)

project(DigitalClock LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)


find_package(QT NAMES Qt5 dirCOMPONENTS Widgets LinguistTools Network  REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools Network  REQUIRED)

message(STATUS "Building DigitalClock with Qt ${QT_VERSION}")


set(SOURCES
    digitalclock.cpp
    )


add_library(DigitalClock ${SOURCES} )

set_property(TARGET DigitalClock PROPERTY CXX_STANDARD 17)
set_property(TARGET DigitalClock PROPERTY CXX_STANDARD_REQUIRED ON)

target_link_libraries(DigitalClock PRIVATE Qt${QT_VERSION_MAJOR}::Widgets )



# We export this information so that other projects can use it
set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include directories" FORCE)
set(${PROJECT_NAME}_LIB_DIRS ${PROJECT_BINARY_DIR} CACHE INTERNAL "${PROJECT_NAME}: Library directories" FORCE)
