Add option MSGPACK_BUILD_DOCS.

This option explicitly controls the generation of targets related to
Doxygen generation, rather than relying solely on whether Doxygen is
discovered.

It is enabled by default to preserve existing behavior, but if disabled
then no Doxygen targets will be generated. This is useful when the
library is included via CMake's `add_subdirectory()`.
This commit is contained in:
Louis R. Marascio 2021-09-22 11:39:23 -05:00
parent 3bdbf0d2ee
commit b4dcae20cc

View File

@ -24,6 +24,7 @@ OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF)
OPTION (MSGPACK_32BIT "32bit compile" OFF) OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF) OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF) OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF) OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF) OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF) OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
@ -153,6 +154,7 @@ IF (MSGPACK_BUILD_EXAMPLES)
ENDIF () ENDIF ()
# Doxygen # Doxygen
IF (MSGPACK_BUILD_DOCS)
FIND_PACKAGE (Doxygen) FIND_PACKAGE (Doxygen)
IF (DOXYGEN_FOUND) IF (DOXYGEN_FOUND)
LIST (APPEND Doxyfile_cpp_CONTENT LIST (APPEND Doxyfile_cpp_CONTENT
@ -176,6 +178,7 @@ IF (DOXYGEN_FOUND)
VERBATIM VERBATIM
) )
ENDIF () ENDIF ()
ENDIF ()
# Install library. # Install library.
INSTALL (TARGETS msgpackc-cxx INSTALL (TARGETS msgpackc-cxx