From f283f0621607ab8d19b5ca53b31158b41456a6df Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Thu, 14 Jan 2021 15:12:06 +1100 Subject: [PATCH] Make -pkg-config configure option actually work The QtBuildInternals config package file gets processed before feature evaluation occurs. That means INPUT_pkg_config may be defined, but the corresponding FEATURE_pkg_config variable won't have been set/updated yet. Do this check locally because the availability of a number of features is conditional on whether pkg-config is available. Change-Id: I6030eb380ee0c630ffbe5db5eed397a46227c7f6 Reviewed-by: Joerg Bornemann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 477f5d21e9d..1663e762959 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -75,6 +75,12 @@ function(qt_build_internals_disable_pkg_config_if_needed) set(pkg_config_enabled OFF) 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) + endif() + # If user explicitly specified a value for the feature, honor it, even if it might break # the build. if(DEFINED FEATURE_pkg_config)