summaryrefslogtreecommitdiffstats
path: root/cmake/QtDocsHelpers.cmake
diff options
context:
space:
mode:
authorChristophe Giboudeaux <christophe@krop.fr>2020-02-09 18:09:38 +0100
committerChristophe Giboudeaux <christophe@krop.fr>2020-11-10 16:54:42 +0100
commit30ba185583285cb3381b0115184ff3b553b3611e (patch)
tree8ae138cbcf85bef87826a5a06ed76bf8d4cbbce2 /cmake/QtDocsHelpers.cmake
parent9fa071d3fe419e4c5319c1af1a46c7cd4771b45f (diff)
CMake: Allow using DESTDIR when installing documentation
Previously, QtDocsHelpers.cmake was invoking CMake to copy files or directories instead of using installation targets. This resulted in DESTDIR being ignored. Now we create installation targets and ask CMake to install them. Change-Id: Idbc79d47a37f9ca865d28543bdbbdde3ba448fa3 Fixes: QTBUG-87382 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtDocsHelpers.cmake')
-rw-r--r--cmake/QtDocsHelpers.cmake27
1 files changed, 20 insertions, 7 deletions
diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
index 6b7a307b25..8e4bd28918 100644
--- a/cmake/QtDocsHelpers.cmake
+++ b/cmake/QtDocsHelpers.cmake
@@ -162,19 +162,32 @@ function(qt_internal_add_docs)
add_dependencies(qch_docs qch_top_level_docs_${target})
if (QT_WILL_INSTALL)
+ install(DIRECTORY "${qdoc_output_dir}/"
+ DESTINATION "${INSTALL_DOCDIR}/${doc_target}"
+ COMPONENT _install_html_docs_${target}
+ EXCLUDE_FROM_ALL
+ )
+
add_custom_target(install_html_docs_${target}
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- "${qdoc_output_dir}"
- "${CMAKE_INSTALL_PREFIX}/${INSTALL_DOCDIR}/${doc_target}"
+ COMMAND ${CMAKE_COMMAND}
+ --install "${CMAKE_BINARY_DIR}"
+ --component _install_html_docs_${target}
COMMENT "Installing html docs for target ${target}"
)
+ install(FILES "${qch_file_path}"
+ DESTINATION "${INSTALL_DOCDIR}/${qch_file_name}"
+ COMPONENT _install_qch_docs_${target}
+ EXCLUDE_FROM_ALL
+ )
+
add_custom_target(install_qch_docs_${target}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${qch_file_path}"
- "${CMAKE_INSTALL_PREFIX}/${INSTALL_DOCDIR}/${qch_file_name}"
+ COMMAND ${CMAKE_COMMAND}
+ --install "${CMAKE_BINARY_DIR}"
+ --component _install_qch_docs_${target}
COMMENT "Installing qch docs for target ${target}"
- )
+ )
+
else()
# Don't need to do anything when not installing
add_custom_target(install_html_docs_${target})