forked from Archive/PX4-Autopilot
cmake ignore doxygen option when not a standalone build (#488)
This commit is contained in:
parent
4a8a3a4079
commit
48a17b5234
|
@ -191,29 +191,33 @@ endif()
|
|||
#=============================================================================
|
||||
# Doxygen
|
||||
#
|
||||
option(BUILD_DOXYGEN "Build doxygen documentation" OFF)
|
||||
# Only in standalone build
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
|
||||
if (BUILD_DOXYGEN)
|
||||
find_package(Doxygen)
|
||||
if (DOXYGEN_FOUND)
|
||||
# set input and output files
|
||||
set(DOXYGEN_IN ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
|
||||
# request to configure the file
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target(doxygen ALL
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating documentation with Doxygen"
|
||||
DEPENDS
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Doxygen needs to be installed to generate documentation")
|
||||
option(BUILD_DOXYGEN "Build doxygen documentation" OFF)
|
||||
|
||||
if (BUILD_DOXYGEN)
|
||||
find_package(Doxygen)
|
||||
if (DOXYGEN_FOUND)
|
||||
# set input and output files
|
||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
|
||||
# request to configure the file
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target(doxygen ALL
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating documentation with Doxygen"
|
||||
DEPENDS
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Doxygen needs to be installed to generate documentation")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue