docs: fix build without opencv_contrib (avoid links to CUDA modules)
authorAlexander Alekhin <alexander.alekhin@intel.com>
Wed, 26 Sep 2018 12:24:52 +0000 (15:24 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Wed, 26 Sep 2018 12:24:52 +0000 (15:24 +0300)
doc/CMakeLists.txt
doc/Doxyfile.in
doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown
doc/tutorials/gpu/gpu-thrust-interop/gpu_thrust_interop.markdown
doc/tutorials/gpu/table_of_content_gpu.markdown
doc/tutorials/introduction/transition_guide/transition_guide.markdown
doc/tutorials/tutorials.markdown

index 7fd97b1..2dfbbb8 100644 (file)
@@ -20,6 +20,12 @@ if(DOXYGEN_FOUND)
 
   set(OPENCV_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0" CACHE STRING "URI to a MathJax installation")
 
+  set(OPENCV_DOCS_EXCLUDE_CUDA ON)
+  if(";${OPENCV_MODULES_EXTRA};" MATCHES ";cudev;")
+    set(OPENCV_DOCS_EXCLUDE_CUDA OFF)
+    list(APPEND CMAKE_DOXYGEN_ENABLED_SECTIONS "CUDA_MODULES")
+  endif()
+
   # gathering headers
   set(paths_include)
   set(paths_doc)
@@ -38,6 +44,15 @@ if(DOXYGEN_FOUND)
       if(EXISTS "${header_dir}")
         list(APPEND paths_include "${header_dir}")
         list(APPEND deps ${header_dir})
+        if(OPENCV_DOCS_EXCLUDE_CUDA)
+          if(EXISTS "${OPENCV_MODULE_opencv_${m}_LOCATION}/include/opencv2/${m}/cuda")
+            list(APPEND CMAKE_DOXYGEN_EXCLUDE_LIST "${OPENCV_MODULE_opencv_${m}_LOCATION}/include/opencv2/${m}/cuda")
+          endif()
+          file(GLOB list_cuda_files "${OPENCV_MODULE_opencv_${m}_LOCATION}/include/opencv2/${m}/*cuda*.hpp")
+          if(list_cuda_files)
+            list(APPEND CMAKE_DOXYGEN_EXCLUDE_LIST ${list_cuda_files})
+          endif()
+        endif()
       endif()
       # doc folder
       set(docs_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/doc")
@@ -124,6 +139,8 @@ if(DOXYGEN_FOUND)
   # set export variables
   string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_hal_interface} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial} ; ${tutorial_contrib_root}")
   string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial}")
+  string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXCLUDE_LIST "${CMAKE_DOXYGEN_EXCLUDE_LIST}")
+  string(REPLACE ";" " " CMAKE_DOXYGEN_ENABLED_SECTIONS "${CMAKE_DOXYGEN_ENABLED_SECTIONS}")
   # TODO: remove paths_doc from EXAMPLE_PATH after face module tutorials/samples moved to separate folders
   string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXAMPLE_PATH  "${example_path} ; ${paths_doc} ; ${paths_sample}")
   set(CMAKE_DOXYGEN_LAYOUT "${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml")
index 1d2c43c..df01651 100644 (file)
@@ -85,7 +85,7 @@ GENERATE_TODOLIST      = YES
 GENERATE_TESTLIST      = YES
 GENERATE_BUGLIST       = YES
 GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS       =
+ENABLED_SECTIONS       = @CMAKE_DOXYGEN_ENABLED_SECTIONS@
 MAX_INITIALIZER_LINES  = 30
 SHOW_USED_FILES        = YES
 SHOW_FILES             = YES
@@ -104,7 +104,7 @@ INPUT                  = @CMAKE_DOXYGEN_INPUT_LIST@
 INPUT_ENCODING         = UTF-8
 FILE_PATTERNS          =
 RECURSIVE              = YES
-EXCLUDE                =
+EXCLUDE                = @CMAKE_DOXYGEN_EXCLUDE_LIST@
 EXCLUDE_SYMLINKS       = NO
 EXCLUDE_PATTERNS       = *.inl.hpp *.impl.hpp *_detail.hpp */cudev/**/detail/*.hpp *.m */opencl/runtime/*
 EXCLUDE_SYMBOLS        = cv::DataType<*> cv::traits::* int void CV__*
index 9452bc3..f3ee984 100644 (file)
@@ -1,3 +1,4 @@
+@cond CUDA_MODULES
 Similarity check (PNSR and SSIM) on the GPU {#tutorial_gpu_basics_similarity}
 ===========================================
 @todo update this tutorial
@@ -204,3 +205,4 @@ It may be just the improvement needed for your application to work. You may obse
 instance of this on the [YouTube here](https://www.youtube.com/watch?v=3_ESXmFlnvY).
 
 @youtube{3_ESXmFlnvY}
+@endcond
index 0332808..9e47f09 100644 (file)
@@ -1,3 +1,4 @@
+@cond CUDA_MODULES
 Using a cv::cuda::GpuMat with thrust {#tutorial_gpu_thrust_interop}
 ===========================================
 
@@ -68,3 +69,4 @@ Next we will determine how many values are greater than 0 by using thrust::count
 
 We will use those results to create an output buffer for storing the copied values, we will then use copy_if with the same predicate to populate the output buffer.
 Lastly we will download the values into a CPU mat for viewing.
+@endcond
index 163f5e3..8acd617 100644 (file)
@@ -1,3 +1,4 @@
+@cond CUDA_MODULES
 GPU-Accelerated Computer Vision (cuda module) {#tutorial_table_of_content_gpu}
 =============================================
 
@@ -20,3 +21,4 @@ run the OpenCV algorithms.
 
     This tutorial will show you how to wrap a GpuMat into a thrust iterator in order to be able to
     use the functions in the thrust library.
+@endcond
index a1df271..c0f063b 100644 (file)
@@ -236,7 +236,10 @@ for(;;){
 
 CUDA {#tutorial_transition_hints_cuda}
 ----
-_cuda_ module has been split into several smaller pieces:
+
+CUDA modules has been moved into opencv_contrib repository.
+
+@cond CUDA_MODULES
 - _cuda_ - @ref cuda
 - _cudaarithm_ - @ref cudaarithm
 - _cudabgsegm_ - @ref cudabgsegm
@@ -249,10 +252,7 @@ _cuda_ module has been split into several smaller pieces:
 - _cudastereo_ - @ref cudastereo
 - _cudawarping_ - @ref cudawarping
 - _cudev_ - @ref cudev
-
-`gpu` namespace has been removed, use cv::cuda namespace instead. Many classes has also been renamed, for example:
-- `gpu::FAST_GPU` -> cv::cuda::FastFeatureDetector
-- `gpu::createBoxFilter_GPU` -> cv::cuda::createBoxFilter
+@endcond
 
 Documentation format {#tutorial_transition_docs}
 --------------------
index 53f8bc2..5b9f58d 100644 (file)
@@ -76,11 +76,13 @@ As always, we would be happy to hear your comments and receive your contribution
 
     Learn how to create beautiful photo panoramas and more with OpenCV stitching pipeline.
 
+@cond CUDA_MODULES
 -   @subpage tutorial_table_of_content_gpu
 
     Squeeze out every
     little computational power from your system by utilizing the power of your video card to run the
     OpenCV algorithms.
+@endcond
 
 -   @subpage tutorial_table_of_content_ios