summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2023-03-05 17:35:03 +0300
committerDmitry Shachnev <mitya57@gmail.com>2023-03-06 18:55:51 +0000
commite7763d972a4404b283260d29ebf7720a981349cb (patch)
treef83acfff5c03f129fd81e7ca1643cc65ff280249
parent1a6cfb0af220926f8b00219c5dd7feb36bcaa0d2 (diff)
downloadqbs-e7763d972a4404b283260d29ebf7720a981349cb.tar.gz
cmake: Find qdoc directly instead of relying on qmake path
Qt6ToolsToolsTargets.cmake provides a Qt6::qdoc target, so there is no need to guess qdoc path based on qmake path. It is the same file where Qt6::qhelpgenerator is defined, which we use here too. This fixes build on Debian where we moved Qt6::qmake into a different path to help with cross-building, leaving Qt6::qdoc where it was. Change-Id: I9e66ffafc8aeb18edc1fe2b27608caa4ee90c3f7 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--cmake/QbsDocumentation.cmake22
1 files changed, 3 insertions, 19 deletions
diff --git a/cmake/QbsDocumentation.cmake b/cmake/QbsDocumentation.cmake
index c8c1635e7..bdcec664f 100644
--- a/cmake/QbsDocumentation.cmake
+++ b/cmake/QbsDocumentation.cmake
@@ -40,23 +40,6 @@ function(qt_query_qmake)
endforeach()
endfunction()
-# Find programs:
-function(_qbs_doc_find_program result_var)
- if (NOT TARGET Qt${QT_VERSION_MAJOR}::qmake)
- message(FATAL_ERROR "QDoc is only available in Qt projects")
- endif()
-
- get_target_property(_qmake_binary Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
- get_filename_component(_qmake_dir "${_qmake_binary}" DIRECTORY)
- find_program("_prg_${result_var}" ${ARGN} HINTS "${_qmake_dir}")
- if ("_prg_${result_var}" STREQUAL "_prg_${result_var}-NOTFOUND")
- set("_prg_${result_var}" "${result_var}-NOTFOUND")
- message(WARNING "Could not find binary for ${result_var}")
- endif()
-
- set(${result_var} "${_prg_${result_var}}" PARENT_SCOPE)
-endfunction()
-
function(_qbs_setup_doc_targets)
# Set up important targets:
if (NOT TARGET qbs_html_docs)
@@ -114,6 +97,8 @@ function(_qbs_setup_qdoc_targets _qdocconf_file _retval)
list(APPEND _env "${_export}=${${_export}}")
endforeach()
+ get_target_property(_qdoc Qt${QT_VERSION_MAJOR}::qdoc IMPORTED_LOCATION)
+
set(_full_qdoc_command "${_qdoc}")
if (_env)
set(_full_qdoc_command "${CMAKE_COMMAND}" "-E" "env" ${_env} "${_qdoc}")
@@ -246,8 +231,7 @@ endfunction()
function(_qbs_qdoc_build_qdocconf_file _qdocconf_file)
_qbs_setup_doc_targets()
- _qbs_doc_find_program(_qdoc NAMES qdoc qdoc-qt5)
- if (_qdoc STREQUAL "_prg__qdoc-NOTFOUND")
+ if (NOT TARGET Qt${QT_VERSION_MAJOR}::qdoc)
message(WARNING "No qdoc binary found: No documentation targets were generated")
return()
endif()