diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-06-09 15:52:02 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-15 11:22:43 +0000 |
commit | 7ce8fcf2eeecf4b8132d228a98bc9a5bd0ad4221 (patch) | |
tree | e1196ebfba6246c2b30e82324d800634febc487b /cmake | |
parent | d23661c6c587af5bdc9f090574cbd674a8e98367 (diff) |
Make configure -no-pkg-config actually work
Turning off pkg-config with the configure flag -no-pkg-config did not
work. There are different defaults for FEATURE_pkg_config on different
platforms (e.g. Linux: ON, Windows: OFF). The existing code that
calculated the initial FEATURE_pkg_config value assumed that the default
is OFF and never turned the feature off.
Fixes: QTBUG-104123
Change-Id: I33b9687c55c60d4ec9224324951a8838741ee976
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4cef4f1c1be713e932052968ac853ec37750ae61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index e9ea74c19c..944a4fef99 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -128,9 +128,14 @@ function(qt_build_internals_disable_pkg_config_if_needed) endif() # Features won't have been evaluated yet if this is the first run, have to evaluate this here - if(NOT "${FEATURE_pkg_config}" AND "${INPUT_pkg_config}" - AND NOT "${INPUT_pkg_config}" STREQUAL "undefined") - set(FEATURE_pkg_config ON) + if ((NOT DEFINED "FEATURE_pkg_config") AND (DEFINED "INPUT_pkg_config") + AND (NOT "${INPUT_pkg_config}" STREQUAL "undefined") + AND (NOT "${INPUT_pkg_config}" STREQUAL "")) + if(INPUT_pkg_config) + set(FEATURE_pkg_config ON) + else() + set(FEATURE_pkg_config OFF) + endif() endif() # If user explicitly specified a value for the feature, honor it, even if it might break |