diff --git a/CMakeLists.txt b/CMakeLists.txt index b33597715..43887ac2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ CMAKE_POLICY(SET CMP0022 NEW) # TODO: # Update to NEW and fix things up -CMAKE_POLICY(SET CMP0023 OLD) +CMAKE_POLICY(SET CMP0023 NEW) # Let AUTOMOC and AUTOUIC process generated files CMAKE_POLICY(SET CMP0071 NEW) diff --git a/TomahawkAddLibrary.cmake b/TomahawkAddLibrary.cmake index e32cc1ce0..c325828fd 100644 --- a/TomahawkAddLibrary.cmake +++ b/TomahawkAddLibrary.cmake @@ -45,9 +45,6 @@ function(tomahawk_add_library) add_library(${target} SHARED ${LIBRARY_SOURCES}) endif() - # HACK: add qt modules - every lib should define its own set of modules - target_link_libraries(${target} Qt5::Core Qt5::Network Qt5::Widgets Qt5::Sql Qt5::Xml) - # definitions - can this be moved into set_target_properties below? add_definitions(${QT_DEFINITIONS}) set_target_properties(${target} PROPERTIES AUTOMOC TRUE) @@ -70,12 +67,12 @@ function(tomahawk_add_library) endif() # add link targets - target_link_libraries(${target} ${TOMAHAWK_LIBRARIES}) + target_link_libraries(${target} PRIVATE ${TOMAHAWK_LIBRARIES}) if(LIBRARY_LINK_LIBRARIES) - target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES}) + target_link_libraries(${target} PUBLIC ${LIBRARY_LINK_LIBRARIES}) endif() if(LIBRARY_LINK_PRIVATE_LIBRARIES) - target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES}) + target_link_libraries(${target} PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES}) endif() # add soversion diff --git a/src/infoplugins/linux/CMakeLists.txt b/src/infoplugins/linux/CMakeLists.txt index 8730b62f0..a99e100f1 100644 --- a/src/infoplugins/linux/CMakeLists.txt +++ b/src/infoplugins/linux/CMakeLists.txt @@ -2,13 +2,14 @@ SET(fdo_srcs fdonotify/FdoNotifyPlugin.cpp fdonotify/ImageConverter.cpp ) -SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES}) +SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES} Qt5::DBus) qt5_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml FreedesktopNotificationsProxy) tomahawk_add_plugin(fdonotify TYPE infoplugin EXPORT_MACRO INFOPLUGINDLLEXPORT_PRO - SOURCES "${fdo_srcs}" LINK_LIBRARIES "${FDO_LINK_LIBRARIES}" + SOURCES "${fdo_srcs}" + LINK_LIBRARIES "${FDO_LINK_LIBRARIES}" ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 976d7b61a..d264b66fd 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -490,15 +490,12 @@ set_target_properties( OUTPUT_NAME ${TOMAHAWK_BASE_TARGET_NAME} ) -target_link_libraries(${TOMAHAWK_LIBRARY} +target_link_libraries(${TOMAHAWK_LIBRARY} PUBLIC Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebKitWidgets Qt5::Concurrent Qt5::Xml Qt5::UiTools Qt5::Svg ) if(APPLE) target_link_libraries(${TOMAHAWK_LIBRARY} Qt5::MacExtras) endif() -if( UNIX AND NOT APPLE ) - target_link_libraries(${TOMAHAWK_LIBRARY} Qt5::DBus) -endif() IF(QCA2_FOUND) INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} ) @@ -509,8 +506,7 @@ IF( UNIX AND NOT APPLE ) LIST(APPEND LINK_LIBRARIES ${QT_QTDBUS_LIBRARIES} ) ENDIF( UNIX AND NOT APPLE ) -TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY} - LINK_PRIVATE +TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} PRIVATE ${LIBVLC_LIBRARY} # Thirdparty shipped with tomahawk @@ -518,7 +514,7 @@ TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY} ${QTKEYCHAIN_LIBRARIES} ${PRIVATE_LINK_LIBRARIES} - LINK_PUBLIC + PUBLIC # External deps ${QJSON_LIBRARIES} ${LUCENEPP_LIBRARIES} diff --git a/src/tomahawk/CMakeLists.txt b/src/tomahawk/CMakeLists.txt index 6283c09c5..373f295bc 100644 --- a/src/tomahawk/CMakeLists.txt +++ b/src/tomahawk/CMakeLists.txt @@ -180,6 +180,9 @@ endif() if(WIN32) target_link_libraries(${TOMAHAWK_APPLICATION_TARGET} Qt5::WinExtras) endif() +if( UNIX AND NOT APPLE ) + target_link_libraries(${TOMAHAWK_APPLICATION_TARGET} Qt5::DBus) +endif() MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" ) diff --git a/thirdparty/libportfwd/third-party/miniupnpc-1.6/CMakeLists.txt b/thirdparty/libportfwd/third-party/miniupnpc-1.6/CMakeLists.txt index d0a6326d4..35606a310 100644 --- a/thirdparty/libportfwd/third-party/miniupnpc-1.6/CMakeLists.txt +++ b/thirdparty/libportfwd/third-party/miniupnpc-1.6/CMakeLists.txt @@ -107,7 +107,7 @@ endif (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED) if (UPNPC_BUILD_STATIC) add_library (upnpc-static STATIC ${MINIUPNPC_SOURCES}) set_target_properties (upnpc-static PROPERTIES OUTPUT_NAME "miniupnpc") - target_link_libraries (upnpc-static ${LDLIBS}) + target_link_libraries (upnpc-static PRIVATE ${LDLIBS}) set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-static) set (UPNPC_LIBRARY_TARGET upnpc-static) endif (UPNPC_BUILD_STATIC) @@ -117,7 +117,7 @@ if (UPNPC_BUILD_SHARED) set_target_properties (upnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc") set_target_properties (upnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION}) set_target_properties (upnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION}) - target_link_libraries (upnpc-shared ${LDLIBS}) + target_link_libraries (upnpc-shared PRIVATE ${LDLIBS}) set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-shared) set (UPNPC_LIBRARY_TARGET upnpc-shared) endif (UPNPC_BUILD_SHARED) diff --git a/thirdparty/qxt/qxtweb-standalone/CMakeLists.txt b/thirdparty/qxt/qxtweb-standalone/CMakeLists.txt index 548854429..d89b66342 100644 --- a/thirdparty/qxt/qxtweb-standalone/CMakeLists.txt +++ b/thirdparty/qxt/qxtweb-standalone/CMakeLists.txt @@ -71,6 +71,9 @@ ADD_LIBRARY( qxtweb-standalone STATIC ${sources} ) -target_link_libraries( qxtweb-standalone Qt5::Network) +target_link_libraries( qxtweb-standalone PUBLIC + Qt5::Network +) + set_target_properties( qxtweb-standalone PROPERTIES AUTOMOC TRUE )