if(BUILD_USER_MANUAL)
  
  if(UNIX)
    message("")
    message(STATUS "${BoldGreen}Starting configuration for the user manual for ${CMAKE_PROJECT_NAME} ${ColourReset}")
    message("")
    
    # Start by copying the whole user manual directory to the build directory
    file(COPY ${CMAKE_SOURCE_DIR}/doc/user-manual DESTINATION ${CMAKE_BINARY_DIR}/doc/)
    
    # 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_BINARY_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_BINARY_DIR}/doc/user-manual)
    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/CMakeStuff/DC-user-manual.cmake.in
    ${CMAKE_BINARY_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_BINARY_DIR}/doc/user-manual
    COMMENT "Build of the DocBook-based user manual documentation")
    
    install(FILES
      ${CMAKE_BINARY_DIR}/doc/user-manual/build/user-manual/${TARGET}-doc.pdf
      DESTINATION ${DOC_DIR})
      
      install(DIRECTORY 
        ${CMAKE_BINARY_DIR}/doc/user-manual/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()

