#---------------------------------------------------------------------------//
# Copyright (c) 2015 Eleftherios Avramidis <el.avramidis@gmail.com>
#
# Distributed under The MIT License (MIT)
# See accompanying file LICENSE
#---------------------------------------------------------------------------//

cmake_minimum_required (VERSION 3.15)

project(sodecl CXX)

# Target the OpenCL 3.0 API so the 1.x-era calls compile cleanly (no deprecation
# warnings) against modern ICD loaders / headers (opencl-headers 3.0+).
add_compile_definitions(CL_TARGET_OPENCL_VERSION=300)

# Location of the runtime data (solver .cl kernels + Random123 headers the kernels
# #include). Overridable at runtime via the SODECL_DATADIR env var (used by tests).
include(GNUInstallDirs)
set(SODECL_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/sodecl" CACHE PATH
    "Install path for sodecl runtime kernels + Random123 headers")
add_compile_definitions(SODECL_DATADIR="${SODECL_DATADIR}")

# Project dependences
include(cmake/ProjectDependences.cmake)

# Project settings
include(cmake/StandardProjectSettings.cmake)
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_17)

# Standard compiler warnings
add_library(project_warnings INTERFACE)
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)

add_subdirectory(src)
include(GenerateExportHeader)
generate_export_header(sodecl)

add_subdirectory(interfaces)
add_subdirectory(benchmarks)
enable_testing()
add_subdirectory(tests)
add_subdirectory(examples)