mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
cmake: fix Qt resources linkage. Closes #5080
Qt resource is innitialized by a static object constructor (see https://wiki.qt.io/QtResources). When we put resources into a static library, the linker removes that static objects and thus the resources themselves. To correct that we append resources to the main executable sources list. This is done via custom function qbt_target_sources which knows where to read the executable' name.
This commit is contained in:
committed by
sledgehammer999
parent
fd156580a0
commit
b137eb01ed
@@ -26,10 +26,11 @@ if (QT4_FOUND)
|
||||
endif(NOT SYSTEM_QJSON)
|
||||
endif (QT4_FOUND)
|
||||
|
||||
set(QBT_WEBUI_RESOURCES webui.qrc)
|
||||
add_library(qbt_webui STATIC ${QBT_WEBUI_HEADERS} ${QBT_WEBUI_SOURCES} ${QBT_WEBUI_RESOURCES})
|
||||
qbt_target_sources(webui.qrc)
|
||||
|
||||
add_library(qbt_webui STATIC ${QBT_WEBUI_HEADERS} ${QBT_WEBUI_SOURCES})
|
||||
target_link_libraries(qbt_webui qbt_base)
|
||||
|
||||
if (QT4_FOUND)
|
||||
target_link_libraries(qbt_webui qjson)
|
||||
target_link_libraries(qbt_webui qjson)
|
||||
endif (QT4_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user