1
0
Fork 0

Fix target_prepare_qrc when generator expression evaluates into nothing

This commit is contained in:
Ilya Fedin 2022-10-03 09:00:11 +04:00 committed by John Preston
parent bcd5e3a640
commit 74fbd92f9f

View file

@ -23,13 +23,17 @@ function(target_prepare_qrc target_name)
else() else()
set(rcc_flags --binary "$<TARGET_PROPERTY:${target_name},AUTORCC_OPTIONS>") set(rcc_flags --binary "$<TARGET_PROPERTY:${target_name},AUTORCC_OPTIONS>")
set(qrc_files_all "$<FILTER:$<TARGET_PROPERTY:${target_name},SOURCES>,INCLUDE,\\.qrc$>") set(qrc_files)
if (WIN32) get_target_property(list ${target_name} SOURCES)
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(mac|darwin|osx|linux|posix)\\.>") foreach (entry ${list})
elseif (APPLE) get_source_file_property(skip_autogen ${entry} SKIP_AUTOGEN)
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(win|linux)\\.>") if (NOT ${entry} MATCHES "\\.qrc$" OR skip_autogen)
elseif (LINUX) continue()
set(qrc_files "$<FILTER:${qrc_files_all},EXCLUDE,(win|mac|darwin|osx)\\.>") endif()
list(APPEND qrc_files ${entry})
endforeach()
if (NOT qrc_files)
return()
endif() endif()
set(rcc_file ${target_name}.rcc) set(rcc_file ${target_name}.rcc)
set(rcc_path "${CMAKE_BINARY_DIR}/${rcc_file}") set(rcc_path "${CMAKE_BINARY_DIR}/${rcc_file}")