Commit 7db13c7a authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #7847 from alalek:install_docs_target_2.4

parents af0ee306 7241b90d
...@@ -278,12 +278,14 @@ if (ANDROID) ...@@ -278,12 +278,14 @@ if (ANDROID)
endif() endif()
endif() endif()
if(ANDROID OR WIN32) if(NOT DEFINED OPENCV_DOC_INSTALL_PATH)
set(OPENCV_DOC_INSTALL_PATH doc) if(ANDROID OR WIN32)
elseif(INSTALL_TO_MANGLED_PATHS) set(OPENCV_DOC_INSTALL_PATH doc)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc) elseif(INSTALL_TO_MANGLED_PATHS)
else() set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) else()
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
endif()
endif() endif()
if(WIN32) if(WIN32)
......
...@@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX) ...@@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
function(ocv_doc_add_file_to_fake_root source destination) function(ocv_doc_add_file_to_fake_root source destination)
add_custom_command( add_custom_command(
OUTPUT "${DOC_FAKE_ROOT}/${destination}" 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}" DEPENDS "${source}"
COMMENT "Copying ${destination} to fake root..." COMMENT "Copying ${destination} to fake root..."
VERBATIM VERBATIM
...@@ -184,4 +184,16 @@ if(HAVE_DOC_GENERATOR) ...@@ -184,4 +184,16 @@ if(HAVE_DOC_GENERATOR)
foreach(f ${OPTIONAL_DOC_LIST}) foreach(f ${OPTIONAL_DOC_LIST})
install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" OPTIONAL COMPONENT docs) install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" OPTIONAL COMPONENT docs)
endforeach() 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) endif(HAVE_DOC_GENERATOR)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment