CMakeLists.txt 1.73 KB
# Minimum CMake version required
cmake_minimum_required(VERSION 3.8)

# Project
project(othello_qtclient VERSION 0.1 LANGUAGES CXX)




################################
# Find required Qt libraries
find_package(Qt5Core 5.11)
find_package(Qt5Quick 5.11)
find_package(Qt5Gui 5.11)
#find_package(Qt5Qml 5.11)


set( HDRS
  gamemodel.h
  guiapplication.h )

set( SRCS
  main.cpp
  gamemodel.cpp
  guiapplication.cpp )

QT5_WRAP_CPP( HDRS_MOC
  gamemodel.h
  guiapplication.h )

QT5_ADD_RESOURCES( RCCS_MOC
  resources/qml.qrc )


add_executable( ${PROJECT_NAME}
  ${SRCS} ${HDRS} ${HDRS_MOC} ${RCCS_MOC}
  )

# TURN ON C++17 FEATURES
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17 )

# Compiler spesific options
target_compile_options(${PROJECT_NAME}
  PUBLIC $<$<CXX_COMPILER_ID:Clang>:
    # Mandatory compiler flags
    -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic
    -pedantic -Werror

    # Disable clangs overtidyness for documentation
    -Wno-documentation

    # Deal with Qt - which is not 100% clangified ><
    -Wno-padded
    -Wno-redundant-parens

    # Stuff we want to deal with later
    -Wno-weak-vtables
    >
  PUBLIC $<$<CXX_COMPILER_ID:GNU>:
    # Mandatory compiler flags
    -pedantic -Wall -Werror
    >
    )



##############################
# Configure othello interfaces
find_package(othello_interfaces REQUIRED CONFIG NO_DEFAULT_PATH)

###############################
# Configure othello game engine
find_package(othello_game_engine REQUIRED CONFIG NO_DEFAULT_PATH)


#####################################
# Setup/configure target dependencies
target_link_libraries( ${PROJECT_NAME}
  Qt5::Core
  Qt5::Quick
  Qt5::Gui
#  Qt5::3DQuick
#  Qt5::3DExtras
  othello::othello_interfaces
  othello::othello_game_engine
  )