cmake_minimum_required(VERSION 3.20)
project(Renderive VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(RENDERIVE_BUILD_2D "Build 2D renderer" ON)
option(RENDERIVE_BUILD_QT "Build Qt integration" ON)
option(RENDERIVE_BUILD_WEB "Build Web integration" ON)
option(RENDERIVE_BUILD_TESTS "Build tests" ON)
option(RENDERIVE_BUILD_3D "Build 3D renderer" OFF)
if (RENDERIVE_BUILD_QT AND NOT RENDERIVE_BUILD_2D)
    message(FATAL_ERROR "RENDERIVE_BUILD_QT requires RENDERIVE_BUILD_2D")
endif ()
if (RENDERIVE_BUILD_WEB AND NOT RENDERIVE_BUILD_2D)
    message(FATAL_ERROR "RENDERIVE_BUILD_WEB requires RENDERIVE_BUILD_2D")
endif ()
if (RENDERIVE_BUILD_3D)
    message(FATAL_ERROR "RENDERIVE_BUILD_3D is reserved; the 3D renderer is not implemented")
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/third_party/build_infra/start.cmake")
if (RENDERIVE_BUILD_TESTS)
    enable_testing()
endif ()
add_subdirectory(Kernel)
if (RENDERIVE_BUILD_2D)
    add_subdirectory(render_2D)
endif ()
if (RENDERIVE_BUILD_QT)
    add_subdirectory(Qt)
endif ()
if (RENDERIVE_BUILD_WEB)
    add_subdirectory(web_server)
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/cmake/RenderivePackage.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/third_party/build_infra/end.cmake")
