cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0046 NEW)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0071 NEW)

project(maraiah-tycho-hermes CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")

find_package(
   Qt5 5.6.0
   CONFIG
      REQUIRED
      COMPONENTS Core Widgets
)

add_library(
   maraiah-tycho-hermes
   SHARED
      $ENV{OUT_DIR}/bindings.cc
      $ENV{OUT_DIR}/bindings.h
      cc/main.cc
      cc/mapmodel.cc
      cc/mapprops.cc
      cc/mapview.cc
      cc/menu.cc
      cc/project.cc
      cc/tycho.h
      resources/resources.qrc
      ui/about.ui
      ui/license.ui
      ui/mapprops.ui
      ui/mapview.ui
      ui/menu.ui
      ui/points.ui
      ui/project.ui
)

set_target_properties(
   maraiah-tycho-hermes
   PROPERTIES
      CXX_STANDARD          17
      CXX_STANDARD_REQUIRED ON
)

target_include_directories(
   maraiah-tycho-hermes
   PUBLIC
      $ENV{OUT_DIR}
)

target_link_libraries(
   maraiah-tycho-hermes
      Qt5::Core
      Qt5::Widgets
)

target_compile_definitions(
   maraiah-tycho-hermes
   PUBLIC
      -DQT_DEPRECATED_WARNINGS
      -DQT_STRICT_ITERATORS
      -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
)

install(TARGETS maraiah-tycho-hermes)

## EOF
