cmake: Add function to get a target property, with empty string as fallback
Change-Id: Ic39fefb91e9ca0f36c815c969ff1072767a9ab16 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
504647a28f
commit
a32ae53b88
@ -151,3 +151,12 @@ function(qt_re_escape out_var str)
|
|||||||
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" regex "${str}")
|
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" regex "${str}")
|
||||||
set(${out_var} ${regex} PARENT_SCOPE)
|
set(${out_var} ${regex} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Gets a target property, and returns "" if the property was not found
|
||||||
|
function(qt_internal_get_target_property out_var target property)
|
||||||
|
get_target_property(result "${target}" "${property}")
|
||||||
|
if("${result}" STREQUAL "result-NOTFOUND")
|
||||||
|
set(result "")
|
||||||
|
endif()
|
||||||
|
set(${out_var} "${result}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user