Revert "CMake: Reduce the number of find_dependency calls"

This reverts commit a3cb002511d7e2cc73234611795c1947620aedd5.

This lead to configuration errors on some machines, blocking
development.

Change-Id: Ibb785c96c7d85692a6e22a73e086119eb571df71
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Lars Knoll 2020-09-13 12:16:34 +02:00
parent b0c51f86f4
commit 6e1a570dc8
3 changed files with 14 additions and 11 deletions

View File

@ -11,10 +11,6 @@ foreach(_target_dep ${_third_party_deps})
if(version)
list(APPEND find_package_args "${version}")
endif()
if(components)
string(REPLACE " " ";" components "${components}")
list(APPEND find_package_args COMPONENTS ${components})
endif()
# Already build an error message, because find_dependency calls return() on failure.
set(__@INSTALL_CMAKE_NAMESPACE@_message "\nPackage: ${pkg}")
@ -27,7 +23,12 @@ foreach(_target_dep ${_third_party_deps})
set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE
"${__@INSTALL_CMAKE_NAMESPACE@_message}")
find_dependency(${find_package_args})
if(components)
string(REPLACE " " ";" components "${components}")
find_dependency(${find_package_args} COMPONENTS ${components})
else()
find_dependency(${find_package_args})
endif()
endforeach()
set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND TRUE)

View File

@ -15,12 +15,13 @@ foreach(_target_dep ${_third_party_deps})
if(version)
list(APPEND find_package_args "${version}")
endif()
if(components)
string(REPLACE " " ";" components "${components}")
list(APPEND find_package_args COMPONENTS ${components})
find_dependency(${find_package_args} COMPONENTS ${components})
else()
find_dependency(${find_package_args})
endif()
find_dependency(${find_package_args})
endforeach()
# Find Qt tool package.

View File

@ -11,12 +11,13 @@ foreach(_target_dep ${_third_party_deps})
if(version)
list(APPEND find_package_args "${version}")
endif()
if(components)
string(REPLACE " " ";" components "${components}")
list(APPEND find_package_args COMPONENTS ${components})
find_dependency(${find_package_args} COMPONENTS ${components})
else()
find_dependency(${find_package_args})
endif()
find_dependency(${find_package_args})
endforeach()
# note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0"