From 95c27e325f47cff168a85c21b4b9e592168384f9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 9 Aug 2019 12:47:55 +0200 Subject: Fix add_qt_resource behavior with regards to unspecified prefixes This change makes the PREFIX parameter a required parameter if the target does not specify a default. This way the behavior is clear when reading the code: add_qt_resource() without PREFIX means it must come frmo the target. Change-Id: I79024e70e7b4d32a5164b93aa08ec9ff409b2d39 Reviewed-by: Alexandru Croitor Reviewed-by: Leander Beernaert --- cmake/QtBuild.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmake/QtBuild.cmake') diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8ef77d6726..e14d7c1391 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2541,6 +2541,9 @@ function(add_qt_resource target resourceName) if(NOT rcc_PREFIX) get_target_property(rcc_PREFIX ${target} QT_RESOURCE_PREFIX) + if (NOT rcc_PREFIX) + message(FATAL_ERROR "add_qt_resource() was called without a PREFIX and the target does not provide QT_RESOURCE_PREFIX. Please either add a PREFIX or make the target ${target} provide a default.") + endif() endif() # Apply quick compiler pass -- cgit v1.2.3