[opencv] 76/89: cmake: special target to build/install docs only

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sat May 13 09:57:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.2
in repository opencv.

commit 7241b90dec00d673c8f348abd8a50bde4161daea
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Fri Dec 9 20:03:05 2016 +0300

    cmake: special target to build/install docs only
---
 CMakeLists.txt     | 14 ++++++++------
 doc/CMakeLists.txt | 14 +++++++++++++-
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6c8adb..3f2ceb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -278,12 +278,14 @@ if (ANDROID)
   endif()
 endif()
 
-if(ANDROID OR WIN32)
-  set(OPENCV_DOC_INSTALL_PATH doc)
-elseif(INSTALL_TO_MANGLED_PATHS)
-  set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
-else()
-  set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
+if(NOT DEFINED OPENCV_DOC_INSTALL_PATH)
+  if(ANDROID OR WIN32)
+    set(OPENCV_DOC_INSTALL_PATH doc)
+  elseif(INSTALL_TO_MANGLED_PATHS)
+    set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
+  else()
+    set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
+  endif()
 endif()
 
 if(WIN32)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 29d5a0a..ebb3855 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
   function(ocv_doc_add_file_to_fake_root source destination)
     add_custom_command(
       OUTPUT "${DOC_FAKE_ROOT}/${destination}"
-      COMMAND "${CMAKE_COMMAND}" -E copy "${source}" "${DOC_FAKE_ROOT}/${destination}"
+      COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${source}" "${DOC_FAKE_ROOT}/${destination}"
       DEPENDS "${source}"
       COMMENT "Copying ${destination} to fake root..."
       VERBATIM
@@ -184,4 +184,16 @@ if(HAVE_DOC_GENERATOR)
   foreach(f ${OPTIONAL_DOC_LIST})
     install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" OPTIONAL COMPONENT docs)
   endforeach()
+
+  # Alias to build/install docs only
+  set(__deps "")
+  foreach(target docs html_docs doxygen)
+    if(TARGET ${target})
+      list(APPEND __deps ${target})
+    endif()
+  endforeach()
+  add_custom_target(install_docs
+      DEPENDS ${__deps}
+      COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=docs -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
+  )
 endif(HAVE_DOC_GENERATOR)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list