# To use CUDA by enabling language
cmake_minimum_required(VERSION 3.18)
{% if info.device == "gpu" -%}
project(NAUNET VERSION {{ version }} LANGUAGES CUDA CXX)
{% else %}
project(NAUNET VERSION {{ version }} LANGUAGES CXX)
{% endif %}

include(CMakePrintHelpers)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Debug)
endif()

if(CMAKE_BUILD_TYPE STREQUAL Debug)
    add_definitions(-DNAUNET_DEBUG)
endif()

message(STATUS "CMAKE_SYSTEM_NAME          = ${CMAKE_SYSTEM_NAME}"         )
message(STATUS "CMAKE_CXX_COMPILER_ID      = ${CMAKE_CXX_COMPILER_ID}"     )
message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "CMAKE_COMPILER_IS_GNUCXX   = ${CMAKE_COMPILER_IS_GNUCXX}"  )
message(STATUS "CMAKE_BUILD_TYPE           = ${CMAKE_BUILD_TYPE}"          )

set(USE_BOOST ON)
find_package(Boost 1.65 REQUIRED)
message(STATUS "Boost_INCLUDE_DIRS         = ${Boost_INCLUDE_DIRS}"        )
message(STATUS "Boost_LIBRARY_DIRS         = ${Boost_LIBRARY_DIRS}"        )

# find_package(CUDA REQUIRED)
# find_package(CUDAToolkit REQUIRED)

set(NVIDIA_GPU_COUNT 0)

set(MAKE_STATIC ON CACHE BOOL "")
set(MAKE_SHARED ON CACHE BOOL "")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

enable_testing()

add_subdirectory(src)
add_subdirectory(test)

