camitk_application( ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx
                    CEP_NAME SDK
                    DESCRIPTION "Provides information about your CamiTK configuration and installation"
)

if(NOT APPLICATION_CONFIG)
    message(FATAL_ERROR "APPLICATION_CONFIG cannot be set to OFF, it is mandatory for any CamiTK installation")
else()
    # get more revision information
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CamiTKVersionInformation.h.in ${CMAKE_CURRENT_BINARY_DIR}/CamiTKVersionInformation.h @ONLY)
endif()

# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
set(SHIBOKEN_CAMITK_SDK_PATH ${SHIBOKEN_CAMITK_SDK_PATH}:${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")

# Add config test
find_program (BASH_PROGRAM bash)
if(BASH_PROGRAM)
    add_test(NAME ${APPLICATION_TARGET_NAME}-bash-test 
             COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/testing/config-test.sh -inbuild ${PROJECT_BINARY_DIR}
    )
    # add test to this subproject (can be tested in local build dir using "ctest -L application-config")    
    set_tests_properties(${APPLICATION_TARGET_NAME}-bash-test PROPERTIES LABELS ${APPLICATION_TARGET_NAME})
endif(BASH_PROGRAM)
