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)
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
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)