From 4cef4f1c1be713e932052968ac853ec37750ae61 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 9 Jun 2022 15:52:02 +0200 Subject: [PATCH] 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. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104123 Change-Id: I33b9687c55c60d4ec9224324951a8838741ee976 Reviewed-by: Alexandru Croitor --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 5c30cc76dc..6ade39fc8d 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