mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-09 00:27:28 +03:00
f050f15a0c
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.
20 lines
429 B
CMake
20 lines
429 B
CMake
set(QBT_LINEEDIT_SOURCES
|
|
src/lineedit.cpp
|
|
)
|
|
|
|
set(QBT_LINEEDIT_HEADERS
|
|
src/lineedit.h
|
|
)
|
|
|
|
set(QBT_LINEEDIT_RESOURCES
|
|
resources/lineeditimages.qrc
|
|
)
|
|
|
|
add_library(qbt_lineedit STATIC ${QBT_LINEEDIT_SOURCES} ${QBT_LINEEDIT_HEADERS})
|
|
if (QT4_FOUND)
|
|
target_link_libraries(qbt_lineedit Qt4::QtGui)
|
|
else (QT4_FOUND)
|
|
target_link_libraries(qbt_lineedit Qt5::Widgets)
|
|
endif (QT4_FOUND)
|
|
|
|
qbt_target_sources(${QBT_LINEEDIT_RESOURCES})
|