diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-09-14 09:37:03 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-09-14 15:03:14 +0200 |
commit | 6718dea390d3bf1a463e589dbf2a605a1886bb14 (patch) | |
tree | ba934715b903008eeb52eb188022536091db1aa7 /cmake/QtConfigDependencies.cmake.in | |
parent | b96d350cff150cde6925c4e9a5e4d235ad8a7737 (diff) |
Revert "Revert "CMake: Add facility to mark package dependencies as optional""
This reverts commit b0c51f86f40b6b6d18fe2bb75cc851d36395240d.
The build failure caused by 58c1c6ee5c986d502b56eb1cc57f1d9444d42031 has
been fixed.
Change-Id: Ic7458d54c7a874588e8b1bfeca61df1842763656
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtConfigDependencies.cmake.in')
-rw-r--r-- | cmake/QtConfigDependencies.cmake.in | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cmake/QtConfigDependencies.cmake.in b/cmake/QtConfigDependencies.cmake.in index 3792e9394e..52d6421b5e 100644 --- a/cmake/QtConfigDependencies.cmake.in +++ b/cmake/QtConfigDependencies.cmake.in @@ -1,14 +1,15 @@ set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND FALSE) -# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" +# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;" set(_third_party_deps "@third_party_deps@") @third_party_extra@ foreach(_target_dep ${_third_party_deps}) list(GET _target_dep 0 pkg) - list(GET _target_dep 1 version) - list(GET _target_dep 2 components) + list(GET _target_dep 1 is_optional) + list(GET _target_dep 2 version) + list(GET _target_dep 3 components) set(find_package_args "${pkg}") if(version) list(APPEND find_package_args "${version}") @@ -29,7 +30,14 @@ foreach(_target_dep ${_third_party_deps}) set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE "${__@INSTALL_CMAKE_NAMESPACE@_message}") - find_dependency(${find_package_args}) + if(is_optional) + if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) + list(APPEND find_package_args QUIET) + endif() + find_package(${find_package_args}) + else() + find_dependency(${find_package_args}) + endif() endforeach() set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND TRUE) |