Qt: Attempt to fix build order again

This commit is contained in:
Vicki Pfau 2022-05-30 22:43:38 -07:00
parent 4f9cfd5a7e
commit 14f217963c
1 changed files with 8 additions and 4 deletions

View File

@ -265,16 +265,20 @@ else()
endif()
if(BUILD_UPDATER)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/updater.qrc INPUT ${CMAKE_CURRENT_SOURCE_DIR}/updater.qrc.in)
if(DEFINED CMAKE_CONFIGURATION_TYPES)
# Required for e.g. MSVC
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/updater.qrc INPUT ${CMAKE_CURRENT_SOURCE_DIR}/updater.qrc.in)
else()
# Required for qt_add_resources to manage dependencies properly
# TODO: Figure out how to do this with MSVC too
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/updater.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/updater.qrc)
endif()
if(TARGET Qt6::Core)
qt_add_resources(UPDATER_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/updater.qrc)
else()
qt5_add_resources(UPDATER_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/updater.qrc)
endif()
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/updater.qrc PROPERTIES GENERATED ON)
if(BUILD_UPDATER)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/updater.qrc PROPERTIES OBJECT_DEPENDS updater-stub)
endif()
list(APPEND RESOURCES ${UPDATER_RESOURCES})
endif()
if(APPLE)