Browse Source

Merge pull request #545 from dota17/make_doc

add doc target in cmake
tags/json-c-0.14-20200419
Eric Haszlakiewicz GitHub 5 years ago
parent
commit
30e00cf757
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions
  1. +18
    -0
      CMakeLists.txt
  2. +8
    -0
      README.md

+ 18
- 0
CMakeLists.txt View File

@@ -317,6 +317,24 @@ set(JSON_C_SOURCES
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})

# generate doxygen documentation for json-c API

find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation(requires Doxygen)" ${DOXYGEN_FOUND})

if (DOXYGEN_FOUND)

add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# request to configure the file
configure_file(Doxyfile Doxyfile)

else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif(DOXYGEN_FOUND)

# XXX for a normal full distribution we'll need to figure out
# XXX how to build both shared and static libraries.
# Probably leverage that to build a local VALGRIND=1 library for testing too.


+ 8
- 0
README.md View File

@@ -230,6 +230,14 @@ JSONC_TEST_TRACE=1 make test
```
and check the log files again.

To get doxygen documentation

The libray documentation can be generated directly from the source codes using Doxygen tool:

```sh
make doc
google-chrome ../doc/html/index.html
```


Linking to `libjson-c` <a name="linking">


Loading…
Cancel
Save