diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-13 12:16:08 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-13 12:20:56 +0200 |
commit | b0c51f86f40b6b6d18fe2bb75cc851d36395240d (patch) | |
tree | 1e8a71101c55bd21937ed58c19ad4441e30c9116 /cmake | |
parent | f0873a1c62cb880b2586ebda0f40e69c930c1cec (diff) |
Revert "CMake: Add facility to mark package dependencies as optional"
This reverts commit 3685483c4b79b4075bab6d341174a395359d1b4a.
This lead to configuration errors on some machines, blocking
development.
Change-Id: I309cdd55a8ef64899afcbeca54458d1c6d686951
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtConfigDependencies.cmake.in | 16 | ||||
-rw-r--r-- | cmake/QtFindPackageHelpers.cmake | 10 | ||||
-rw-r--r-- | cmake/QtModuleDependencies.cmake.in | 16 | ||||
-rw-r--r-- | cmake/QtPluginDependencies.cmake.in | 16 | ||||
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 3 |
5 files changed, 17 insertions, 44 deletions
diff --git a/cmake/QtConfigDependencies.cmake.in b/cmake/QtConfigDependencies.cmake.in index bccf6b372c..49e08b7ba6 100644 --- a/cmake/QtConfigDependencies.cmake.in +++ b/cmake/QtConfigDependencies.cmake.in @@ -1,13 +1,12 @@ -# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;" +# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" 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 is_optional) - list(GET _target_dep 2 version) - list(GET _target_dep 3 components) + list(GET _target_dep 1 version) + list(GET _target_dep 2 components) set(find_package_args "${pkg}") if(version) list(APPEND find_package_args "${version}") @@ -28,14 +27,7 @@ foreach(_target_dep ${_third_party_deps}) set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE "${__@INSTALL_CMAKE_NAMESPACE@_message}") - 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() + find_dependency(${find_package_args}) endforeach() set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND TRUE) diff --git a/cmake/QtFindPackageHelpers.cmake b/cmake/QtFindPackageHelpers.cmake index c68ba4d14a..0ca585d1d4 100644 --- a/cmake/QtFindPackageHelpers.cmake +++ b/cmake/QtFindPackageHelpers.cmake @@ -15,8 +15,7 @@ endfunction() macro(qt_find_package) # Get the target names we expect to be provided by the package. - set(find_package_options CONFIG NO_MODULE MODULE REQUIRED) - set(options ${find_package_options} MARK_OPTIONAL) + set(options CONFIG NO_MODULE MODULE REQUIRED) set(oneValueArgs MODULE_NAME QMAKE_LIB) set(multiValueArgs PROVIDED_TARGETS COMPONENTS) cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -91,7 +90,7 @@ macro(qt_find_package) endif() # Ensure the options are back in the original unparsed arguments - foreach(opt IN LISTS find_package_options) + foreach(opt IN LISTS options) if(arg_${opt}) list(APPEND arg_UNPARSED_ARGUMENTS ${opt}) endif() @@ -130,9 +129,8 @@ macro(qt_find_package) set(qt_find_package_target_name ${aliased_target}) endif() - set_target_properties(${qt_find_package_target_name} PROPERTIES - INTERFACE_QT_PACKAGE_NAME ${ARGV0} - INTERFACE_QT_PACKAGE_IS_OPTIONAL ${arg_MARK_OPTIONAL}) + set_target_properties(${qt_find_package_target_name} + PROPERTIES INTERFACE_QT_PACKAGE_NAME ${ARGV0}) if(package_version) set_target_properties(${qt_find_package_target_name} PROPERTIES INTERFACE_QT_PACKAGE_VERSION ${ARGV1}) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index 24d132b57d..3d19fac784 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -4,14 +4,13 @@ find_dependency(@INSTALL_CMAKE_NAMESPACE@ @PROJECT_VERSION@ PATHS "${CMAKE_CURRENT_LIST_DIR}/.." ${QT_EXAMPLES_CMAKE_PREFIX_PATH} NO_DEFAULT_PATH ) -# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;" +# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" set(_third_party_deps "@third_party_deps@") foreach(_target_dep ${_third_party_deps}) list(GET _target_dep 0 pkg) - list(GET _target_dep 1 is_optional) - list(GET _target_dep 2 version) - list(GET _target_dep 3 components) + list(GET _target_dep 1 version) + list(GET _target_dep 2 components) set(find_package_args "${pkg}") if(version) list(APPEND find_package_args "${version}") @@ -21,14 +20,7 @@ foreach(_target_dep ${_third_party_deps}) list(APPEND find_package_args COMPONENTS ${components}) endif() - 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() + find_dependency(${find_package_args}) endforeach() # Find Qt tool package. diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in index 9d16bedeba..bae6d85c7b 100644 --- a/cmake/QtPluginDependencies.cmake.in +++ b/cmake/QtPluginDependencies.cmake.in @@ -1,13 +1,12 @@ set(@target@_FOUND FALSE) -# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;" +# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" set(_third_party_deps "@third_party_deps@") foreach(_target_dep ${_third_party_deps}) list(GET _target_dep 0 pkg) - list(GET _target_dep 1 is_optional) - list(GET _target_dep 2 version) - list(GET _target_dep 3 components) + list(GET _target_dep 1 version) + list(GET _target_dep 2 components) set(find_package_args "${pkg}") if(version) list(APPEND find_package_args "${version}") @@ -17,14 +16,7 @@ foreach(_target_dep ${_third_party_deps}) list(APPEND find_package_args COMPONENTS ${components}) endif() - 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() + find_dependency(${find_package_args}) endforeach() # note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0" diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 56b2d5e56f..0da6d9e4c3 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -43,7 +43,6 @@ macro(qt_collect_third_party_deps target) get_target_property(package_name ${dep} INTERFACE_QT_PACKAGE_NAME) if(dep_seen EQUAL -1 AND package_name) list(APPEND third_party_deps_seen ${dep}) - get_target_property(package_is_optional ${dep} INTERFACE_QT_PACKAGE_IS_OPTIONAL) get_target_property(package_version ${dep} INTERFACE_QT_PACKAGE_VERSION) if(NOT package_version) set(package_version "") @@ -55,7 +54,7 @@ macro(qt_collect_third_party_deps target) endif() list(APPEND third_party_deps - "${package_name}\;${package_is_optional}\;${package_version}\;${package_components}") + "${package_name}\;${package_version}\;${package_components}") endif() endif() endforeach() |