mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-10 12:21:16 +01:00

* Support for both in-source and out-of-source builds * Set library version to 0.12 to map Debian package * Add separate options to build tests, examples and documentation * Add pkgconfig lookup support (if installed with `make install`) * Add CMake lookup support (if isntalled with `make install`) * Add Google Test Source lookup * Add CTest support for running tests (use `make test` or `ctest -V`)
24 lines
831 B
CMake
24 lines
831 B
CMake
find_package(Doxygen)
|
|
|
|
IF(NOT DOXYGEN_FOUND)
|
|
MESSAGE(STATUS "No Doxygen found. Documentation won't be built")
|
|
ELSE()
|
|
file(GLOB SOURCES ${CMAKE_SOURCE_DIR}/include/*)
|
|
file(GLOB MARKDOWN_DOC ${CMAKE_SOURCE_DIR}/doc/*.md)
|
|
list(APPEND MARKDOWN_DOC ${CMAKE_SOURCE_DIR}/readme.md)
|
|
|
|
CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
|
|
|
|
add_custom_command(OUTPUT html
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html
|
|
DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
)
|
|
|
|
add_custom_target(doc ALL DEPENDS html)
|
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
|
|
DESTINATION ${DOC_INSTALL_DIR}
|
|
COMPONENT doc)
|
|
ENDIF()
|