diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9879d2c6..acceb1baef 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,19 +182,6 @@ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE set(CPACK_RPM_PACKAGE_NAME ${RDC_PACKAGE}) set(CPACK_RPM_PACKAGE_VERSION ${PKG_VERSION_STR}) -# Generate Doxygen documentation -find_package(Doxygen) -if (DOXYGEN_FOUND) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/rdc_doxygen.cfg - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - add_custom_target(doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" VERBATIM) -else() - message("Doxygen is not found. Will not generate documents.") -endif(DOXYGEN_FOUND) - ## Add the packaging directives include (CPack) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 74af85a444..20c0736eb6 100755 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -164,6 +164,41 @@ install(TARGETS ${CLIENT_LIB} # DESTINATION ${RDC}/include/rdc # COMPONENT ${CLIENT_COMPONENT}) +# Generate Doxygen documentation for client api manual +find_package(Doxygen) +find_package(LATEX COMPONENTS PDFLATEX) +if (DOXYGEN_FOUND AND LATEX_FOUND) + set (RDC_MANUAL_NAME "RDC_API_Manual") + message("Building ${RDC_MANUAL_NAME}.pdf") + configure_file(${PROJECT_SOURCE_DIR}/docs/rdc_doxygen.cfg + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.tex + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + DEPENDS ${PROJECT_SOURCE_DIR}/docs/rdc_doxygen.cfg + "${PROJECT_SOURCE_DIR}/include/rdc/rdc.h" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf + COMMAND make > /dev/null + COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf + ${PROJECT_SOURCE_DIR}/docs/${RDC_MANUAL_NAME}.pdf + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.tex + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex) + + add_custom_target(docs DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf) + + add_dependencies(${CLIENT_LIB} docs) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf + DESTINATION ${RDC}/docs/${RDC_MANUAL_NAME}.pdf + COMPONENT ${CLIENT_COMPONENT}) + install(FILES ${PROJECT_SOURCE_DIR}/docs/README.md + DESTINATION ${RDC}/docs/ + COMPONENT ${CLIENT_COMPONENT}) +else() + message("Doxygen or Latex is not found. Will not generate documents.") +endif(DOXYGEN_FOUND AND LATEX_FOUND) + + message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") message(" Finished Cmake Client Lib ") message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") diff --git a/docs/RDC_API_Manual.pdf b/docs/RDC_API_Manual.pdf new file mode 100644 index 0000000000..8f7cd451a1 Binary files /dev/null and b/docs/RDC_API_Manual.pdf differ diff --git a/docs/RDC_Manual.pdf b/docs/RDC_Manual.pdf deleted file mode 100644 index 9a6b1b3022..0000000000 Binary files a/docs/RDC_Manual.pdf and /dev/null differ diff --git a/docs/rdc_doxygen.cfg b/docs/rdc_doxygen.cfg index 320678123f..9e7b161aa8 100644 --- a/docs/rdc_doxygen.cfg +++ b/docs/rdc_doxygen.cfg @@ -758,8 +758,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/docs/README.md \ - @CMAKE_CURRENT_SOURCE_DIR@/include/rdc/rdc.h +INPUT = @PROJECT_SOURCE_DIR@/include/rdc/rdc.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -908,7 +907,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/docs/RDC_Intro.md +USE_MDFILE_AS_MAINPAGE = @PROJECT_SOURCE_DIR@/docs/README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing