Files
qBittorrent/src/webui/CMakeLists.txt
Eugene Shalygin b137eb01ed 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-06-20 01:50:18 +03:00

37 lines
701 B
CMake

set(QBT_WEBUI_HEADERS
abstractwebapplication.h
btjson.h
extra_translations.h
jsonutils.h
prefjson.h
webapplication.h
websessiondata.h
webui.h
)
set(QBT_WEBUI_SOURCES
abstractwebapplication.cpp
btjson.cpp
prefjson.cpp
webapplication.cpp
webui.cpp
)
if (QT4_FOUND)
if (NOT SYSTEM_QJSON)
add_subdirectory(qjson)
else (NOT SYSTEM_QJSON)
find_package(QJSON REQUIRED)
add_definitions(-DUSE_SYSTEM_QJSON)
endif(NOT SYSTEM_QJSON)
endif (QT4_FOUND)
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)
endif (QT4_FOUND)