if(BUILD_USER_MANUAL)

  message("")
  message(STATUS "${BoldGreen}Starting configuration for the user manual for TARGET ${TARGET} ${ColourReset}")
  message("")

  # The version of the program needs to be set in the user manual front
  # matter.
  CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/CMakeStuff/user-manual-version-entity.ent.in
    ${CMAKE_SOURCE_DIR}/doc/user-manual/xml/user-manual-version-entity.ent @ONLY)

  # Command:
  # make massxpert-doc
  # Makes use of the local Makefile file.
  # Will generate HTML and PDF documentation in the build directory
  add_custom_target(massxpert-doc ALL
    COMMAND make all
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    COMMENT "DocBook-based user manual documentation for massXpert")

  install(FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/build/massxpert-user-manual/massxpert-doc.pdf
    DESTINATION ${DOC_DIR})

  install(DIRECTORY 
    ${CMAKE_CURRENT_SOURCE_DIR}/build/massxpert-user-manual/html/massxpert-user-manual/
    DESTINATION ${DOC_DIR}/html)

  message("")
  message(STATUS "${BoldGreen}Finished configuring the massxpert user manual.${ColourReset}")
  message("")

else()

  message(STATUS "User manual build skipped")

endif()

