diff --git a/CMake/VTKmBuildDocumentation.cmake b/CMake/VTKmBuildDocumentation.cmake index 783cad567..cdf07438a 100644 --- a/CMake/VTKmBuildDocumentation.cmake +++ b/CMake/VTKmBuildDocumentation.cmake @@ -13,6 +13,17 @@ #----------------------------------------------------------------------------- find_package(Doxygen REQUIRED) +#----------------------------------------------------------------------------- +# Function to turn CMake booleans to `YES` or `NO` as expected by Doxygen +#----------------------------------------------------------------------------- +function(to_yes_no variable) + if(${variable}) + set(${variable} YES PARENT_SCOPE) + else() + set(${variable} NO PARENT_SCOPE) + endif() +endfunction() + #----------------------------------------------------------------------------- # Configure Doxygen #----------------------------------------------------------------------------- @@ -20,6 +31,9 @@ set(VTKm_DOXYGEN_HAVE_DOT ${DOXYGEN_DOT_FOUND}) set(VTKm_DOXYGEN_DOT_PATH ${DOXYGEN_DOT_PATH}) set(VTKm_DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/docs/doxyfile) +to_yes_no(VTKm_ENABLE_USERS_GUIDE) +to_yes_no(VTKm_Doxygen_HTML_output) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/doxyfile.in ${VTKm_DOXYFILE} @ONLY) diff --git a/CMake/doxyfile.in b/CMake/doxyfile.in index d8f8f1b4e..ff74e0387 100644 --- a/CMake/doxyfile.in +++ b/CMake/doxyfile.in @@ -202,7 +202,7 @@ IGNORE_PREFIX = # configuration options related to the HTML output #--------------------------------------------------------------------------- -GENERATE_HTML = YES +GENERATE_HTML = @VTKm_Doxygen_HTML_output@ HTML_OUTPUT = html @@ -294,7 +294,7 @@ MAN_LINKS = NO # configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = YES +GENERATE_XML = @VTKm_ENABLE_USERS_GUIDE@ XML_OUTPUT = xml diff --git a/CMakeLists.txt b/CMakeLists.txt index 51bd48faa..ff6f823d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,15 @@ cmake_dependent_option(VTKm_ENABLE_USERS_GUIDE "VTKm_ENABLE_DOCUMENTATION" OFF ) +# If you are building the User's Guide, you may only need the XML output from Doxygen, which +# is much faster than generating the HTML. Thus, give the option to turn on/off the HTML output. +cmake_dependent_option(VTKm_Doxygen_HTML_output + "Build HTML output" + ON + "VTKm_ENABLE_USERS_GUIDE" + ON + ) +mark_as_advanced(VTKm_Doxygen_HTML_output) # We may want to make finer controls on whether libraries/modules get built. # VTK uses the concept of groups for its modules