1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

cmake: make LibtorrentRasterbar::LibTorrent public dependency of qbt_base

If libtorrent include directory not in the compiler search path, we have
to pass it to all qbt targets, because session.h includes
libtorrent/version.hpp
This commit is contained in:
Eugene Shalygin 2017-01-21 16:36:52 +01:00
parent 0cb9884965
commit 13d9dea8ac
2 changed files with 20 additions and 8 deletions

View File

@ -5,11 +5,23 @@
macro (target_link_qt_components target)
if (QT4_FOUND)
foreach(_cmp ${ARGN})
list(APPEND _QT_CMPNTS "Qt4::Qt${_cmp}")
if ("${_cmp}" STREQUAL "PRIVATE" OR
"${_cmp}" STREQUAL "PUBLIC" OR
"${_cmp}" STREQUAL "INTERFACE")
list(APPEND _QT_CMPNTS "${_cmp}")
else()
list(APPEND _QT_CMPNTS "Qt4::Qt${_cmp}")
endif()
endforeach()
else (QT4_FOUND)
foreach(_cmp ${ARGN})
list(APPEND _QT_CMPNTS "Qt5::${_cmp}")
if ("${_cmp}" STREQUAL "PRIVATE" OR
"${_cmp}" STREQUAL "PUBLIC" OR
"${_cmp}" STREQUAL "INTERFACE")
list(APPEND _QT_CMPNTS "${_cmp}")
else()
list(APPEND _QT_CMPNTS "Qt5::${_cmp}")
endif()
endforeach()
endif (QT4_FOUND)
target_link_libraries(${target} ${_QT_CMPNTS})

View File

@ -117,24 +117,24 @@ tristatebool.cpp
)
add_library(qbt_base STATIC ${QBT_BASE_HEADERS} ${QBT_BASE_SOURCES})
target_link_libraries(qbt_base ZLIB::ZLIB LibtorrentRasterbar::LibTorrent)
target_link_qt_components(qbt_base Core Network Xml)
target_link_libraries(qbt_base PRIVATE ZLIB::ZLIB PUBLIC LibtorrentRasterbar::LibTorrent)
target_link_qt_components(qbt_base PUBLIC Core Network Xml)
if (QT4_FOUND)
if (GUI)
target_link_libraries(qbt_base Qt4::QtGui)
target_link_libraries(qbt_base PUBLIC Qt4::QtGui)
endif (GUI)
else (QT4_FOUND)
if (GUI)
target_link_libraries(qbt_base Qt5::Gui Qt5::Widgets)
target_link_libraries(qbt_base PUBLIC Qt5::Gui Qt5::Widgets)
endif (GUI)
endif (QT4_FOUND)
if (DBUS)
target_link_qt_components(qbt_base DBus)
target_link_qt_components(qbt_base PRIVATE DBus)
endif ()
if (APPLE)
find_library(IOKit_LIBRARY IOKit)
find_library(Carbon_LIBRARY Carbon)
target_link_libraries(qbt_base ${Carbon_LIBRARY} ${IOKit_LIBRARY})
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY})
endif (APPLE)