From 8fc59e552fc8b40f24e776a4855d99e23fa419ce Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 29 Oct 2020 20:31:37 +0100 Subject: [PATCH] CMake: Yield fatal error on malformed INSTALL_MKSPECS The value of this variable must be exactly "mkspecs" or end with "/mkspecs". Change-Id: I39f83e9660794dfe23f5fd39fb1084b87ba1f140 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 209a0bf9c2..052f5ea3de 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -49,6 +49,10 @@ qt_configure_process_path(INSTALL_PLUGINSDIR "${INSTALL_ARCHDATADIR}/plugins" "Plugins [ARCHDATADIR/plugins]") +if(NOT INSTALL_MKSPECSDIR MATCHES "(^|/)mkspecs") + message(FATAL_ERROR "INSTALL_MKSPECSDIR must end with '/mkspecs'") +endif() + # Given CMAKE_CONFIG and ALL_CMAKE_CONFIGS, determines if a directory suffix needs to be appended # to each destination, and sets the computed install target destination arguments in OUT_VAR. # Defaults used for each of the destination types, and can be configured per destination type.