summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-07 12:40:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-07-07 12:41:04 (GMT)
commita951eb2cb4b354e521bc6b93c7980e7f22ab1174 (patch)
treed537f01a918ef3fa3596e1ebb233f02620121b40 /Modules
parent17115f0a5b594e76d6e3fa2df1361224e57ddf0f (diff)
parent796b8fcb14072bef72fe324015c0a62e2006b0db (diff)
downloadCMake-a951eb2cb4b354e521bc6b93c7980e7f22ab1174.zip
CMake-a951eb2cb4b354e521bc6b93c7980e7f22ab1174.tar.gz
CMake-a951eb2cb4b354e521bc6b93c7980e7f22ab1174.tar.bz2
Merge topic 'FindDoxygen-create-output-dir'
796b8fcb FindDoxygen: Create DOXYGEN_OUTPUT_DIRECTORY if it doesn't exist Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Craig Scott <craig.scott@crascit.com> Merge-request: !1019
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindDoxygen.cmake14
1 files changed, 11 insertions, 3 deletions
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index fb16f20..46bf340 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -179,7 +179,8 @@ Functions
will be converted to an absolute path relative to the current binary
directory. This is necessary because doxygen will normally be run from a
directory within the source tree so that relative source paths work as
- expected.
+ expected. If this directory does not exist, it will be recursively created
+ prior to executing the doxygen commands.
To change any of these defaults or override any other Doxygen config option,
set relevant variables before calling ``doxygen_add_docs()``. For example:
@@ -1020,6 +1021,13 @@ doxygen_add_docs() for target ${targetName}")
WARN_LOGFILE
XML_OUTPUT
)
+
+ # Store the unmodified value of DOXYGEN_OUTPUT_DIRECTORY prior to invoking
+ # doxygen_quote_value() below. This will mutate the string specifically for
+ # consumption by Doxygen's config file, which we do not want when we use it
+ # later in the custom target's commands.
+ set( _original_doxygen_output_dir ${DOXYGEN_OUTPUT_DIRECTORY} )
+
foreach(_item IN LISTS _doxygen_quoted_options)
doxygen_quote_value(DOXYGEN_${_item})
endforeach()
@@ -1030,8 +1038,8 @@ doxygen_add_docs() for target ${targetName}")
configure_file("${_doxyfile_template}" "${_target_doxyfile}")
# Add the target
- add_custom_target(
- ${targetName}
+ add_custom_target( ${targetName} VERBATIM
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${_original_doxygen_output_dir}
COMMAND "${DOXYGEN_EXECUTABLE}" "${_target_doxyfile}"
WORKING_DIRECTORY "${_args_WORKING_DIRECTORY}"
DEPENDS "${_target_doxyfile}"