summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-06-24 16:25:17 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-06-25 13:32:26 +0200
commitdec84a56f53390423e7ac258e3f1860df5de4513 (patch)
tree506969fbc3f33344d6c84330884f07bb6c9b60f8 /cmake/QtBuild.cmake
parenta527fbf1797fca1a2f764bca85551562be460bb0 (diff)
Throw FATAL_ERROR if specified platform doesn't exist
If user specifies non-existing platform build fails in some non-obvious place, since qplatfromdefs.h couldn't be found. Add an explicit error if the defined platform folder doesn't exists in Qt sources. Change-Id: Id847d57a6f9cc4f463e697b474b8a669cd041fb8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 96d11196d9..2b88456878 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -385,6 +385,17 @@ elseif(QT_QMAKE_TARGET_MKSPEC)
set(QT_DEFAULT_PLATFORM_DEFINITION_DIR "${INSTALL_MKSPECSDIR}/${QT_QMAKE_TARGET_MKSPEC}")
# Used by qtbase itself and consumers of non-prefix builds via BUILD_INTERFACE (absolute path).
set(QT_DEFAULT_PLATFORM_DEFINITION_DIR_ABSOLUTE "${QT_MKSPECS_DIR}/${QT_QMAKE_TARGET_MKSPEC}")
+
+ if(NOT EXISTS "${QT_DEFAULT_PLATFORM_DEFINITION_DIR_ABSOLUTE}")
+ file(GLOB known_platforms
+ LIST_DIRECTORIES true
+ RELATIVE "${QT_MKSPECS_DIR}"
+ "${QT_MKSPECS_DIR}/*"
+ )
+ list(JOIN known_platforms "\n " known_platforms)
+ message(FATAL_ERROR "Unknown platform ${QT_QMAKE_TARGET_MKSPEC}\n\
+Known platforms:\n ${known_platforms}")
+ endif()
endif()
if(NOT DEFINED QT_DEFAULT_PLATFORM_DEFINITIONS)