cmake_minimum_required(VERSION 3.4)

project(RNR)

include(CMake/CreateResources.cmake)

option(COMPILE_PLAYER "Compile the RNR player" ON)
option(COMPILE_STUDIO "Compile the RNR studio" ON)
option(COMPILE_SERVER "Compile the RNR server" ON)

set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/Dependencies)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist)

add_compile_options(-Wno-attributes -Wno-return-type) # Ignore warnings generated by Luau and Qt

find_package(Boost REQUIRED)
find_package(OGRE REQUIRED COMPONENTS Bites CONFIG)
find_package(pugixml REQUIRED)

add_subdirectory(Projects)

if(CI AND UNIX)
    file(COPY ${OGRE_MEDIA_DIR}/Main/ DESTINATION ${CMAKE_BINARY_DIR}/shaders)
    file(COPY ${OGRE_MEDIA_DIR}/RTShaderLib/ DESTINATION ${CMAKE_BINARY_DIR}/shaders)
    file(COPY ${OGRE_PLUGIN_DIR}/ DESTINATION ${CMAKE_BINARY_DIR}/plugins)
endif()