if(BUILD_USER_MANUAL)

  if(UNIX AND NOT APPLE)

    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)

    # The location of the main user manual config file (set fop.xconf file
    # location)
    set(FOP_XCONF_DIR ${CMAKE_SOURCE_DIR}/doc/user-manual)
    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/CMakeStuff/DC-user-manual.cmake.in
      ${CMAKE_SOURCE_DIR}/doc/user-manual/DC-user-manual @ONLY)

    # Command:
    # make usermanual
    # Makes use of the local  Makefile file.
    # Will generate HTML and PDF documentation in the build directory

    message("\tConfiguring the user manual compilation")

    add_custom_target(usermanual
      COMMAND make -f usermanual-makefile all_f
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      COMMENT "Build of the DocBook-based user manual documentation")

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

    install(DIRECTORY 
      ${CMAKE_CURRENT_SOURCE_DIR}/build/user-manual/html/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()

endif()
