#--------------------------------------------
#
#         CamiTK Open Source CEP Set
#
#--------------------------------------------
cmake_minimum_required(VERSION 3.0)

project(camitkopensource)

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

# Specific to SDK: control the version (major, minor, default patch and )
set(CAMITK_PROJECT_NAME "CamiTK")
set(CAMITK_VERSION_MAJOR "4")
set(CAMITK_VERSION_MINOR "0")
set(CAMITK_VER_NICKNAME "red") # Red Amaranth American rose Auburn Burgundy Cardinal Carmine Carnelian Cerise Coquelicot
set(CAMITK_VERSION_PATCH "0") # patch version for packaging, change when appropriate
string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}" CAMITK_SHORT_VERSION_STRING)

# Specific to SDK: this is the SDK build
set(CAMITK_SDK_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-opensource" CACHE STRING "CEP Set Name")

# Configure CamiTK Opensource 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)
set(CAMITK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include(camitk/packaging/CamiTKOpenSourcePackaging)
camitk_opensource_packaging()

# CamiTK 4.0 is C++11 compliant
set(CMAKE_CXX_FLAGS "-std=c++11")

# 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
add_subdirectory(imaging)
add_subdirectory(modeling)

# Do we wrapp CamiTK for scripting it into Python using Shiboken and PySide ?
set(CAMITK_BINDING_PYTHON CACHE BOOL FALSE)

# Consider python binding only if the CMake variable is checked
if(CAMITK_BINDING_PYTHON)
    add_subdirectory(python_sdk)
endif()

camitk_sub_project_validate(CEP_SET)
