summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Hawicz <erh+git@nimenees.com>2020-05-18 15:30:21 -0400
committerGitHub <noreply@github.com>2020-05-18 15:30:21 -0400
commitfbe15436447b8b6e2c9eb4419fdc37cc8ef5b2cc (patch)
tree4b73a45fc2a72a8324352a9dbd87de0e4e7c8558
parentfa6a7dccb926b1bdb65be74733389a1fbcf9734e (diff)
parent1e94da779a9aa107690e4f2921ab4d0300aca579 (diff)
downloadjson-c-fbe15436447b8b6e2c9eb4419fdc37cc8ef5b2cc.tar.gz
Merge pull request #622 from besser82/topic/besser82/doc_subdir
doc: Move Doxyfile into doc subdir.
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt23
-rw-r--r--doc/CMakeLists.txt16
-rw-r--r--doc/Doxyfile.in (renamed from Doxyfile.in)2
4 files changed, 21 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index 958ace3..1cdaf9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,7 +83,7 @@
/Testing/
# ...and build artifacts.
-/doc
+/doc/html
/libjson-c.a
/libjson-c.so
/libjson-c.so.*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f58301c..333513c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,9 +237,9 @@ endif()
# Once we've done basic symbol/header searches let's add them in.
configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h)
-message(STATUS "Written ${PROJECT_BINARY_DIR}/config.h")
+message(STATUS "Wrote ${PROJECT_BINARY_DIR}/config.h")
configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h)
-message(STATUS "Written ${PROJECT_BINARY_DIR}/json_config.h")
+message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
@@ -361,24 +361,7 @@ 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)
-
- configure_file(${PROJECT_SOURCE_DIR}/Doxyfile.in
- ${PROJECT_BINARY_DIR}/Doxyfile)
- message(STATUS "Written ${PROJECT_BINARY_DIR}/Doxyfile")
-
- add_custom_target(doc
- COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
-
-else (DOXYGEN_FOUND)
- message("Warning: doxygen not found, the 'doc' target will not be included")
-endif(DOXYGEN_FOUND)
+add_subdirectory(doc)
# uninstall
add_custom_target(uninstall
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..4872d8e
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,16 @@
+# generate doxygen documentation for json-c API
+
+find_package(Doxygen)
+
+if (DOXYGEN_FOUND)
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+ message(STATUS "Wrote ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
+
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+else (DOXYGEN_FOUND)
+ message("Warning: doxygen not found, the 'doc' target will not be included")
+endif(DOXYGEN_FOUND)
diff --git a/Doxyfile.in b/doc/Doxyfile.in
index 42a0853..ce8d8ff 100644
--- a/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = doc
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and