if(BUILD_USER_MANUAL)

  message("")
  message(STATUS "${BoldGreen}Starting configuration for the user manual for ${CMAKE_PROJECT_NAME} ${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 minexpert-doc
  # Makes use of the local  Makefile file.
  # Will generate HTML and PDF documentation in the build directory
  add_custom_target(${TARGET_LOWERCASE}-doc ALL
    COMMAND make all
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    COMMENT "DocBook-based user manual documentation for ${CMAKE_PROJECT_NAME}")

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

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

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

else()

  message(STATUS "User manual build skipped")

endif()


