qBittorrent/src/gui/lineedit/CMakeLists.txt
Eugene Shalygin f050f15a0c 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.
2016-04-17 01:06:24 +02:00

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})