File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -278,12 +278,14 @@ if (ANDROID)
278
278
endif ()
279
279
endif ()
280
280
281
- if (ANDROID OR WIN32 )
282
- set (OPENCV_DOC_INSTALL_PATH doc )
283
- elseif (INSTALL_TO_MANGLED_PATHS )
284
- set (OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc )
285
- else ()
286
- set (OPENCV_DOC_INSTALL_PATH share/OpenCV/doc )
281
+ if (NOT DEFINED OPENCV_DOC_INSTALL_PATH )
282
+ if (ANDROID OR WIN32 )
283
+ set (OPENCV_DOC_INSTALL_PATH doc )
284
+ elseif (INSTALL_TO_MANGLED_PATHS )
285
+ set (OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc )
286
+ else ()
287
+ set (OPENCV_DOC_INSTALL_PATH share/OpenCV/doc )
288
+ endif ()
287
289
endif ()
288
290
289
291
if (WIN32 )
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
49
49
function (ocv_doc_add_file_to_fake_root source destination )
50
50
add_custom_command (
51
51
OUTPUT "${DOC_FAKE_ROOT} /${destination} "
52
- COMMAND "${CMAKE_COMMAND} " -E copy "${source} " "${DOC_FAKE_ROOT} /${destination} "
52
+ COMMAND "${CMAKE_COMMAND} " -E copy_if_different "${source} " "${DOC_FAKE_ROOT} /${destination} "
53
53
DEPENDS "${source} "
54
54
COMMENT "Copying ${destination} to fake root..."
55
55
VERBATIM
@@ -184,4 +184,16 @@ if(HAVE_DOC_GENERATOR)
184
184
foreach (f ${OPTIONAL_DOC_LIST} )
185
185
install (FILES "${f} " DESTINATION "${OPENCV_DOC_INSTALL_PATH} " OPTIONAL COMPONENT docs )
186
186
endforeach ()
187
+
188
+ # Alias to build/install docs only
189
+ set (__deps "" )
190
+ foreach (target docs html_docs doxygen )
191
+ if (TARGET ${target} )
192
+ list (APPEND __deps ${target} )
193
+ endif ()
194
+ endforeach ()
195
+ add_custom_target (install_docs
196
+ DEPENDS ${__deps}
197
+ COMMAND "${CMAKE_COMMAND} " -DCMAKE_INSTALL_COMPONENT=docs -P "${CMAKE_BINARY_DIR} /cmake_install.cmake"
198
+ )
187
199
endif (HAVE_DOC_GENERATOR )
You can’t perform that action at this time.
0 commit comments