##############################################################################
# \file  CMakeLists.txt
# \brief CMake file to generate project documentation.
#
# This CMake files builds and/or installs the documentation of the software
# package. The documentation can be divided into user documentation
# (user manual) and developer documentation (developer manual). For
# developers, the documentation of the API is of particular interest,
# where developers who are responsible for maintaining the software
# package may be provided with even more detailed documentation of the
# implementation details. These details are not necessarily distributed
# publicly with the software package, but internally at SBIA.
#
# For copyright information please see Copyright.txt in the root
# directory of the project.
#
# Contact: SBIA Group <sbia-software@uphs.upenn.edu>
##############################################################################

# ============================================================================
# update
# ============================================================================

# See documentation of module SbiaUpdate.cmake for details.

sbia_update (CMakeLists.txt)
sbia_update (Doxyfile.in)

# ============================================================================
# ReadMe
# ============================================================================

# configure ReadMe files and copy them to binary tree
configure_file (ReadMe.html.in "${CMAKE_CURRENT_BINARY_DIR}/ReadMe.html" @ONLY)
configure_file (ReadMe.css     "${CMAKE_CURRENT_BINARY_DIR}/ReadMe.css" COPYONLY)

# install ReadMe files
install (
  FILES
    "${CMAKE_CURRENT_BINARY_DIR}/ReadMe.html"
    "${CMAKE_CURRENT_BINARY_DIR}/ReadMe.css"
  DESTINATION "${INSTALL_DOC_DIR}"
)

# ============================================================================
# ChangeLog
# ============================================================================

sbia_add_doc (
  ChangeLog
  GENERATOR svn2cl
)

# ============================================================================
# API documentation
# ============================================================================

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# <sbia-custom>

# The following CMake code adds an API documentation to the 'doc' target which
# is automatically generated by Doxygen from the in-source code comments.
# Please refer to the documentation of sbia_add_doc () for details.
#
# \see sbia_add_doc ()

# filters used to convert files which are not natively supported by
# Doxygen to a format which Doxygen can process to generate documentation
set (DOXYGEN_FILTER_MATLAB "${CMAKE_CURRENT_SOURCE_DIR}/matlab2cpp.pl")
set (DOXYGEN_FILTER_BASH   "${CMAKE_CURRENT_SOURCE_DIR}/bash2cpp.pl")

sbia_add_doc (
  API
  GENERATOR Doxygen
    DOXYGEN_DOXYFILE        "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
    DOXYGEN_FILTER_PATTERNS "*.m=${DOXYGEN_FILTER_MATLAB} *.sh=${DOXYGEN_FILTER_BASH}"
)

# </sbia-custom>
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# ============================================================================
# manuals
# ============================================================================

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# <sbia-custom>

# Add CMake code to the following customizable section to configure the build
# system of the documentation files in the current directory and/or install
# the documentation files. Consider using the the sbia_add_doc () macro.
#
# \see sbia_add_doc ()

sbia_add_doc (UserManual.pdf)

# </sbia-custom>
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# ============================================================================
# subdirectories
# ============================================================================

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# <sbia-custom>



# </sbia-custom>
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

