diff --git a/CMLibDocBreathe.cmake b/CMLibDocBreathe.cmake index 82068dc..991d2ec 100644 --- a/CMLibDocBreathe.cmake +++ b/CMLibDocBreathe.cmake @@ -31,6 +31,7 @@ function(add_breathe_target) set(GENERATE_XML YES) set(GENERATE_HTML NO) set(GENERATE_LATEX NO) + set(OUTPUT_DIRECTORY ${_BREATHE_HTML_DIR}) configure_file(${_BREATHE_CONF_FILE} ${_BREATHE_BUILD_DIR}/conf.py @ONLY) configure_file(${_BREATHE_DOXY_FILE} ${_BREATHE_BUILD_DIR}/Doxyfile @ONLY) diff --git a/CMLibDocDoxygen.cmake b/CMLibDocDoxygen.cmake index 0f428a0..e9e56cf 100644 --- a/CMLibDocDoxygen.cmake +++ b/CMLibDocDoxygen.cmake @@ -12,7 +12,7 @@ endif() function(add_doxygen_target) if (DOXYGEN_FOUND) set(options) - set(oneValueArgs TARGET_NAME IN OUT LATEX HTML) + set(oneValueArgs TARGET_NAME DOXY_FILE OUTPUT_DIRECTORY LATEX HTML) set(multiValueArgs) cmake_parse_arguments(_DOXYGEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -26,16 +26,16 @@ function(add_doxygen_target) set(GENERATE_LATEX YES) endif() - configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY) + configure_file(${_DOXYGEN_DOXY_FILE} ${_DOXYGEN_OUTPUT_DIRECTORY}/Doxyfile @ONLY) message("Doxygen build started") add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${DOXYGEN_EXECUTABLE} ${_DOXYGEN_OUTPUT_DIRECTORY}/Doxyfile + WORKING_DIRECTORY ${_DOXYGEN_OUTPUT_DIRECTORY} COMMENT "Generating API documentation with Doxygen" VERBATIM) else() add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM - COMMENT "Doxygen is not found. Skipping target ${_BREATHE_TARGET_NAME} build") + COMMENT "Doxygen is not found. Skipping target ${_DOXYGEN_TARGET_NAME} build") endif() endfunction()