#--------------------------------------------
#
#      CamiTK Community Edition CEP Set
#
#-------------------------------------------- 
cmake_minimum_required(VERSION 3.20)

project(camitkcommunityedition)

# CamiTK requires C++20
# All target after this declaration will be compile with c++20 policy
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # for wider compatibility across plateforms and compiler

# Allow testing of the whole camitk-communityedition project
include(CTest)

set(CAMITK_PROJECT_NAME "CamiTK")
# The current version of CamiTK is defined in a separate file to avoid conflict/problem when merging
include(CamiTKVersion.cmake)
string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}" CAMITK_SHORT_VERSION_STRING)

# Specific to the Community Edition: this is the Community Edition build
set(CAMITK_COMMUNITY_EDITION_BUILD TRUE)

#-- This is a CEP set...
set(CAMITK_EXTENSION_PROJECT_SET TRUE CACHE BOOL "Is this a CamiTK Extension Project Set?")
set(CAMITK_EXTENSION_PROJECT_SET_NAME "camitk-communityedition" CACHE STRING "CEP Set Name")

# Configure CamiTK Community Edition packaging.
# Must be done before parsing extensions CMakeLists.txt files.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/sdk/cmake/modules/macros ${CMAKE_CURRENT_SOURCE_DIR}/sdk/cmake/modules)
set(CAMITK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include(camitk/packaging/CamiTKCommunityEditionPackaging)
camitk_communityedition_packaging()

# Configure include-what-you-use to check the current target
include(camitk/test/CamiTKIncludeWhatYouUse)

# Specific to SDK: first compile the SDK (it looks like a CEP but is sooooo special...)
add_subdirectory(sdk)

# ...composed by the following CamiTK Extension Projects (optional)
add_subdirectory(imaging)
add_subdirectory(modeling)

# ... and tutorials that helps understand CamiTK (optional)
add_subdirectory(tutorials)

camitk_write_manifest_data(CEP_SET)
