cmake_minimum_required(VERSION 3.5)
message("Using CMake ${CMAKE_VERSION}\n")

project(LMS LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(PROJECT_TYPE_DEBUG TRUE)
endif()
if(PROJECT_TYPE_DEBUG)
    add_definitions(-DPROJECT_TYPE_DEBUG)
endif()

include(cmake/CommonInfoForProject.cmake)

common_info_for_project(LMS)

find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt5 COMPONENTS Network REQUIRED)
find_package(Qt5 COMPONENTS Sql REQUIRED)
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
find_package(Qt5 COMPONENTS Xml REQUIRED)
find_package(Qt5 COMPONENTS Concurrent REQUIRED)

add_subdirectory(DataBaseLMS)
add_subdirectory(InstructorsAndTrainees)
add_subdirectory(GUIdataBaseLMS)
add_subdirectory(ServerLMS)
add_subdirectory(TestServerLMS)

add_dependencies(InstructorsAndTrainees DataBaseLMS)
add_dependencies(GUIdataBaseLMS InstructorsAndTrainees)
add_dependencies(ServerLMS DataBaseLMS)
add_dependencies(TestServerLMS ServerLMS)
