cmake_minimum_required(VERSION 3.22)
project(gps_denied_onboard LANGUAGES CXX)

# Compile options ----------------------------------------------------------

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE)
endif()

# Helper modules -----------------------------------------------------------

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(build_options)
include(dependencies)
include(strategies)

# Native subprojects -------------------------------------------------------

add_subdirectory(cpp)

# Tests --------------------------------------------------------------------

option(BUILD_TESTING "Enable native unit tests (C++ gtest)" OFF)
if(BUILD_TESTING)
  enable_testing()
  add_subdirectory(cpp/tests)
endif()
