cmake_minimum_required(VERSION 3.20)

project(AdiosCatalyst LANGUAGES C CXX)

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

include (GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")

find_package(ADIOS2 REQUIRED)
find_package(catalyst REQUIRED)

# Always needed to be able to compile Adios2
find_package(MPI REQUIRED)

# Contains the current implementation
add_subdirectory(AdiosCatalyst)
add_subdirectory(AdiosReplay)

# For Examples
option(BUILD_EXAMPLES "Build Examples" OFF)
if(BUILD_EXAMPLES)

  add_subdirectory(Examples)

endif()

# For testing
option(BUILD_TESTING "Build tests" OFF)
if(BUILD_TESTING)

  include(CTest)
  enable_testing()

  add_subdirectory(Testing)
endif()
