diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | cmake/Modules/GrSwig.cmake | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 62eae906b..b6b5eb496 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,10 +124,20 @@ add_custom_target(uninstall ######################################################################## find_package(PythonLibs) find_package(SWIG) + +if(SWIG_FOUND) + message(STATUS "Minimum SWIG version required is 1.3.31") + set(SWIG_VERSION_CHECK FALSE) + if("${SWIG_VERSION}" VERSION_GREATER "1.3.30") + set(SWIG_VERSION_CHECK TRUE) + endif() +endif(SWIG_FOUND) + include(GrComponent) GR_REGISTER_COMPONENT("python-support" ENABLE_PYTHON PYTHONLIBS_FOUND SWIG_FOUND + SWIG_VERSION_CHECK ) find_package(CppUnit) diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index f49fc731c..ced8b16c8 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -72,10 +72,18 @@ function(GR_SWIG_MAKE_DOCS output_file) 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() + #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} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py ${OUTPUT_DIRECTORY}/xml |