diff options
-rw-r--r-- | cmake/Modules/GrSwig.cmake | 30 | ||||
-rw-r--r-- | docs/doxygen/Doxyfile.swig_doc.in | 2 |
2 files changed, 21 insertions, 11 deletions
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index ced8b16c8..512d8e631 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -66,24 +66,34 @@ function(GR_SWIG_MAKE_DOCS output_file) #call doxygen on the Doxyfile + input headers add_custom_command( - OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml + OUTPUT ${OUTPUT_DIRECTORY}/tmp/xml/index.xml + ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps} COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile COMMENT "Generating doxygen xml for ${name} docs" ) - #call sync if we can to flush the doxygen writes to file before python reads - find_program(SYNC_EXECUTABLE sync) - unset(sync_command) - if(SYNC_EXECUTABLE) - set(sync_command COMMAND ${SYNC_EXECUTABLE}) - endif() + # Steps to make sure the Doxygen run is finished before we allow the dependency to be met that + # reads the outputs of this stage. + set(stamp-file "${OUTPUT_DIRECTORY}/xml/${name}.stamp") + add_custom_command( + OUTPUT ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml + DEPENDS ${OUTPUT_DIRECTORY}/tmp/xml/index.xml ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt + COMMAND "${CMAKE_COMMAND}" -E make_directory "${OUTPUT_DIRECTORY}/xml" + COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/tmp/xml/index.xml" "${OUTPUT_DIRECTORY}/" + COMMAND "${CMAKE_COMMAND}" -E copy_directory "${OUTPUT_DIRECTORY}/tmp/xml/" "${OUTPUT_DIRECTORY}/xml/" + COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/index.xml" "${OUTPUT_DIRECTORY}/xml/" + COMMAND "${CMAKE_COMMAND}" -E touch "${stamp-file}" + COMMENT "Waiting for doxygen to finish" + ) + set_source_files_properties(${OUTPUT_DIRECTORY}/xml/index.xml PROPERTIES GENERATED TRUE) + set_source_files_properties(${OUTPUT_DIRECTORY}/xml/combine.xslt PROPERTIES GENERATED TRUE) + set_source_files_properties(${stamp-file} PROPERTIES GENERATED TRUE) #call the swig_doc script on the xml files add_custom_command( - OUTPUT ${output_file} - DEPENDS ${input_files} ${OUTPUT_DIRECTORY}/xml/index.xml - ${sync_command} + OUTPUT ${output_file} + DEPENDS ${input_files} ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py ${OUTPUT_DIRECTORY}/xml diff --git a/docs/doxygen/Doxyfile.swig_doc.in b/docs/doxygen/Doxyfile.swig_doc.in index 94e14bda1..54fdb492d 100644 --- a/docs/doxygen/Doxyfile.swig_doc.in +++ b/docs/doxygen/Doxyfile.swig_doc.in @@ -38,7 +38,7 @@ PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@ +OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@/tmp # 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 |