Fix target_prepare_qrc when generator expression evaluates into nothing
This commit is contained in:
parent
bcd5e3a640
commit
74fbd92f9f
1 changed files with 11 additions and 7 deletions
|
|
@ -23,13 +23,17 @@ function(target_prepare_qrc target_name)
|
|||
else()
|
||||
set(rcc_flags --binary "$<TARGET_PROPERTY:${target_name},AUTORCC_OPTIONS>")
|
||||
|
||||
set(qrc_files_all "$<FILTER:$<TARGET_PROPERTY:${target_name},SOURCES>,INCLUDE,\\.qrc$>")
|
||||
if (WIN32)
|
||||
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(mac|darwin|osx|linux|posix)\\.>")
|
||||
elseif (APPLE)
|
||||
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(win|linux)\\.>")
|
||||
elseif (LINUX)
|
||||
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(win|mac|darwin|osx)\\.>")
|
||||
set(qrc_files)
|
||||
get_target_property(list ${target_name} SOURCES)
|
||||
foreach (entry ${list})
|
||||
get_source_file_property(skip_autogen ${entry} SKIP_AUTOGEN)
|
||||
if (NOT ${entry} MATCHES "\\.qrc$" OR skip_autogen)
|
||||
continue()
|
||||
endif()
|
||||
list(APPEND qrc_files ${entry})
|
||||
endforeach()
|
||||
if (NOT qrc_files)
|
||||
return()
|
||||
endif()
|
||||
set(rcc_file ${target_name}.rcc)
|
||||
set(rcc_path "${CMAKE_BINARY_DIR}/${rcc_file}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue