forked from qt-creator/qt-creator
CMake build: Gracefully handle turned off target in qtc_add_resources
Otherwise qtc_add_resources fails when turning off corresponding BUILD_.... flags, or needs to be wrapped with "if(TARGET ...)" everywhere. Change-Id: I34e230569ab9619b1c107404bf2fdf8e8e86bd7e Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -912,6 +912,10 @@ function(qtc_add_resources target resourceName)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT TARGET ${target})
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
string(REPLACE "/" "_" resourceName ${resourceName})
|
string(REPLACE "/" "_" resourceName ${resourceName})
|
||||||
string(REPLACE "." "_" resourceName ${resourceName})
|
string(REPLACE "." "_" resourceName ${resourceName})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user