#--------------------------------------------
#         CamiTK Extension Project
#--------------------------------------------

# additional settings generated by camitk-extensiongenerator
set(EXTENSION_GENERATOR_CAMITK_DIR "$camitkDir$")
set(EXTENSION_GENERATOR_CMAKE_MODULE_PATH "$camitkCMakeModulePath$")

if (NOT CEP_NAME)
    # There is no CEP declared → the extension is standalone → setup a CEP for this extension
    cmake_minimum_required(VERSION 3.20)

    project($lowerCamelCase(name)$)

    # Find CamiTK SDK
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${EXTENSION_GENERATOR_CMAKE_MODULE_PATH})

    # 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

    find_package(CamiTK REQUIRED)
    include(${CAMITK_USE_FILE})

    # define the CEP and add all possible subprojects
    camitk_extension_project(NAME "$kebabCase(name)$" 
                            CONTACT "$contact.author$ <$contact.email$>"
                            DESCRIPTION "CEP for \"$title(name)$\" extension"
                            LICENSE "$license$"
                            ENABLED
                            # Uncomment the next line to activate the CamiTK testing framework 
                            # and enable component and action automatic tests
                            #ENABLE_TESTING
                            # Uncomment the next line to be able to generate a test coverage html report
                            #ENABLE_TEST_COVERAGE
    )
else()
    # This extension is inside a project, just add all possible subprojects
    camitk_add_subdirectory(libraries)
    camitk_add_subdirectory(components)
    camitk_add_subdirectory(actions)
    camitk_add_subdirectory(viewers)
    camitk_add_subdirectory(applications)
endif()
