diff --git a/CMakeLists.txt b/CMakeLists.txt index adeaa2ae0a..b7f79ae0a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,27 +75,6 @@ target_include_directories(api INTERFACE "include/client") add_subdirectory(source) # docs -# https://vicrucann.github.io/tutorials/quick-cmake-doxygen/ -if(${BUILD_DOCS}) - find_package(Doxygen) - if (DOXYGEN_FOUND) - # Build the doc - set(DOXYGEN_IN ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in) - set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile) - - configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) - message("Doxygen build start") - - add_custom_target( - tdengine_doxygen ALL - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API doxumentation with Doxygen" - VERBATIM - ) - else(DOXYGEN_FOUND) - message("Doxygen need to be installed to generate the doxygen documentation") - endif(DOXYGEN_FOUND) -endif(${BUILD_DOCS}) +add_subdirectory(docs) # tests (TODO) diff --git a/cmake/cmake.options b/cmake/cmake.options index 7b5aeb8e65..88f2b88fa6 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -40,5 +40,5 @@ option( option( BUILD_DOCS "If use doxygen build documents" - ON + OFF ) \ No newline at end of file diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 0000000000..59552c67d7 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generate API documentation +## https://vicrucann.github.io/tutorials/quick-cmake-doxygen/ +if(${BUILD_DOCS}) + find_package(Doxygen) + if (DOXYGEN_FOUND) + # Build the doc + set(DOXYGEN_IN ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in) + set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile) + + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) + message("Doxygen build start") + + add_custom_target( + tdengine_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API doxumentation with Doxygen" + VERBATIM + ) + else(DOXYGEN_FOUND) + message("Doxygen need to be installed to generate the doxygen documentation") + endif(DOXYGEN_FOUND) +endif(${BUILD_DOCS}) \ No newline at end of file diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index bbefffcc3b..207157c415 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "TDengine" +PROJECT_NAME = @CMAKE_PROJECT_NAME@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -829,7 +829,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include source +INPUT = @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/source # 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