# This CMakeLists file will add the source files in this directory for compilation

# common_includes will have all the functions and classes from CBICA_Toolkit_ITK branch and more

# each header file, "$application.h" : main entry point of an application whose input will be either a single "itk::Image" or a "std::vector< itk::Image >"

# each application-specific include folder, "/$application_includes" : dependencies which are not taken care by the default dependencies (i.e., ITK and OpenCV), for example libSVM for recurrence 

FILE( GLOB 
  COMMON_DEPENDENCIES
  "${CMAKE_CURRENT_SOURCE_DIR}/common_includes/*.h"
  "${CMAKE_CURRENT_SOURCE_DIR}/common_includes/*.cpp"
)

SET( SOURCES ${COMMON_DEPENDENCIES} )
SET( INCLUDES "")

SET( APPLICATIONS
  EGFRStatusPredictor
  GeodesicSegmentation
  RecurrenceEstimator
)

FOREACH(application ${APPLICATIONS})

  SET( SOURCES 
    ${SOURCES} 
    "${CMAKE_CURRENT_SOURCE_DIR}/${application}.h"
    "${CMAKE_CURRENT_SOURCE_DIR}/${application}.cpp"
  )
  
  FILE( GLOB 
    APPLICATION_SPECIFIC_DEPENDENCIES
    "${CMAKE_CURRENT_SOURCE_DIR}/${application}_includes/*.h"
    "${CMAKE_CURRENT_SOURCE_DIR}/${application}_includes/*.cpp"
  )
  
  SET( INCLUDES
    ${INCLUDES}
    "${CMAKE_CURRENT_SOURCE_DIR}/${application}_includes/"
  )
  
  SET( SOURCES 
    ${SOURCES} 
    ${APPLICATION_SPECIFIC_DEPENDENCIES}
  )
  
ENDFOREACH()

SET( APPLICATION_SOURCES  "${SOURCES}" CACHE STRING "All Application sources")
SET( APPLICATION_INCLUDES "${INCLUDES}" CACHE STRING "All Application dependencies")

MARK_AS_ADVANCED(${APPLICATION_SOURCES} )
MARK_AS_ADVANCED(${APPLICATION_INCLUDES})