##############################################################################
# \file  CMakeLists.txt
# \brief CMakeLists file to configure build system of all targets.
#
# For copyright information please see Copyright.txt in the root
# directory of the project.
#
# Contact: SBIA Group <sbia-software@uphs.upenn.edu>
##############################################################################

# ============================================================================
# library target(s)
# ============================================================================

# Add library target for each static or shared library (including MEX-files)
# using the macro sbia_add_library (). Note that the maco sbia_add_library ()
# is used the same way as the CMake command add_library ().
#
# See documentation of sbia_add_executable in SbiaMacros.cmake for details.
#
# \see sbia_add_library ()
# \see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_library

sbia_add_library (FeatureExtraction STATIC FeatureExtraction.h FeatureExtraction.cc FeatureExtraction_model.h FeatureExtraction_model.cc)
sbia_add_library (COMPARE_SVM_rfe STATIC COMPARE_SVM_rfe.h COMPARE_SVM_rfe.cc)
sbia_add_library (ImagesReader STATIC ImagesReader.h ImagesReader.cc)

target_link_libraries (ImagesReader ${NiftiCLib_LIBRARY})
target_link_libraries (FeatureExtraction ImagesReader SVMTorch)

# ============================================================================
# executable target(s)
# ============================================================================

# Add executable target for each executable program using the macro
# sbia_add_executable () which is used just the same way as the CMake command
# add_executable () is used.
#
# The source_group () command can be used to group source files within IDEs
# such as the Microsoft Visual Studio IDE, in particular.
#
# See documentation of sbia_add_executable in SbiaMacros.cmake for details.
#
# \see sbia_add_executable ()
# \see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_executable
# \see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:source_group

sbia_add_executable (COMPARE_extract COMPARE_extract.cc)
sbia_add_executable (COMPARE_check_input COMPARE_check_input.cc)
sbia_add_executable (COMPARE_average_score COMPARE_average_score.cc)
sbia_add_executable (COMPARE_build_check COMPARE_build_check.cc)
sbia_add_executable (COMPARE_map_svm_diff_to_region COMPARE_map_svm_diff_to_region.cc)
sbia_add_executable (COMPARE_float_sum COMPARE_float_sum.cc)

sbia_add_executable (COMPARE_build COMPARE_build.cc)
sbia_add_executable (COMPARE_build_loo COMPARE_build_loo.cc)
sbia_add_executable (COMPARE_SVM_discriminate COMPARE_SVM_discriminate.cc) 
sbia_add_executable (COMPARE_model COMPARE_model.cc) 

target_link_libraries (COMPARE_extract FeatureExtraction watershed nrutility)
target_link_libraries (COMPARE_check_input ImagesReader nrutility)
target_link_libraries (COMPARE_average_score  nrutility)
target_link_libraries (COMPARE_map_svm_diff_to_region nrutility)
target_link_libraries (COMPARE_float_sum nrutility)

target_link_libraries (COMPARE_build SVMTorch COMPARE_SVM_rfe nrutility)
target_link_libraries (COMPARE_build_loo SVMTorch COMPARE_SVM_rfe nrutility)
target_link_libraries (COMPARE_SVM_discriminate SVMTorch)
target_link_libraries (COMPARE_model SVMTorch FeatureExtraction nrutility)

# ============================================================================
# scripts
# ============================================================================

# Use the macro sbia_add_script () to add scripts to the project.
#
# For convenience, the functions sbia_add_scripts_by_extension () and
# sbia_add_scripts_by_extensions () add all scripts within the current
# source directory with the given extension(s). The filenames of the scripts
# may contain an optional ".in" suffix or ".in." as any part of the name.
#
# Moreover, sbia_add_scripts () adds all scripts of common scripting languages
# given that the usual filename extensions are used. Hence, in most cases,
# the calling sbia_add_scripts () is sufficient.
#
# See documentation of these macros in SbiaMacros.cmake for details.
#
# \see sbia_add_script
# \see sbia_add_scripts_by_extension
# \see sbia_add_scripts_by_extensions
# \see sbia_add_scripts

sbia_add_scripts ()
