Skip to content

Commit 1ab3ed9

Browse files
committed
Switch CMake policy CMP0023 to NEW
1 parent 9327204 commit 1ab3ed9

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CMAKE_POLICY(SET CMP0022 NEW)
55

66
# TODO:
77
# Update to NEW and fix things up
8-
CMAKE_POLICY(SET CMP0023 OLD)
8+
CMAKE_POLICY(SET CMP0023 NEW)
99

1010
# Let AUTOMOC and AUTOUIC process generated files
1111
CMAKE_POLICY(SET CMP0071 NEW)

TomahawkAddLibrary.cmake

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ function(tomahawk_add_library)
4545
add_library(${target} SHARED ${LIBRARY_SOURCES})
4646
endif()
4747

48-
# HACK: add qt modules - every lib should define its own set of modules
49-
target_link_libraries(${target} Qt5::Core Qt5::Network Qt5::Widgets Qt5::Sql Qt5::Xml)
50-
5148
# definitions - can this be moved into set_target_properties below?
5249
add_definitions(${QT_DEFINITIONS})
5350
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
@@ -70,12 +67,12 @@ function(tomahawk_add_library)
7067
endif()
7168

7269
# add link targets
73-
target_link_libraries(${target} ${TOMAHAWK_LIBRARIES})
70+
target_link_libraries(${target} PRIVATE ${TOMAHAWK_LIBRARIES})
7471
if(LIBRARY_LINK_LIBRARIES)
75-
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
72+
target_link_libraries(${target} PUBLIC ${LIBRARY_LINK_LIBRARIES})
7673
endif()
7774
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
78-
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
75+
target_link_libraries(${target} PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
7976
endif()
8077

8178
# add soversion

src/infoplugins/linux/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ SET(fdo_srcs
22
fdonotify/FdoNotifyPlugin.cpp
33
fdonotify/ImageConverter.cpp
44
)
5-
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES})
5+
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES} Qt5::DBus)
66
qt5_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
77
FreedesktopNotificationsProxy)
88

99
tomahawk_add_plugin(fdonotify
1010
TYPE infoplugin EXPORT_MACRO INFOPLUGINDLLEXPORT_PRO
11-
SOURCES "${fdo_srcs}" LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
11+
SOURCES "${fdo_srcs}"
12+
LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
1213
)
1314

1415
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )

src/libtomahawk/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,15 +490,12 @@ set_target_properties(
490490
OUTPUT_NAME ${TOMAHAWK_BASE_TARGET_NAME}
491491
)
492492

493-
target_link_libraries(${TOMAHAWK_LIBRARY}
493+
target_link_libraries(${TOMAHAWK_LIBRARY} PUBLIC
494494
Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebKitWidgets Qt5::Concurrent Qt5::Xml Qt5::UiTools Qt5::Svg
495495
)
496496
if(APPLE)
497497
target_link_libraries(${TOMAHAWK_LIBRARY} Qt5::MacExtras)
498498
endif()
499-
if( UNIX AND NOT APPLE )
500-
target_link_libraries(${TOMAHAWK_LIBRARY} Qt5::DBus)
501-
endif()
502499

503500
IF(QCA2_FOUND)
504501
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
@@ -509,16 +506,15 @@ IF( UNIX AND NOT APPLE )
509506
LIST(APPEND LINK_LIBRARIES ${QT_QTDBUS_LIBRARIES} )
510507
ENDIF( UNIX AND NOT APPLE )
511508

512-
TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
513-
LINK_PRIVATE
509+
TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} PRIVATE
514510
${LIBVLC_LIBRARY}
515511

516512
# Thirdparty shipped with tomahawk
517513
${LIBPORTFWD_LIBRARIES}
518514
${QTKEYCHAIN_LIBRARIES}
519515
${PRIVATE_LINK_LIBRARIES}
520516

521-
LINK_PUBLIC
517+
PUBLIC
522518
# External deps
523519
${QJSON_LIBRARIES}
524520
${LUCENEPP_LIBRARIES}

src/tomahawk/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ endif()
180180
if(WIN32)
181181
target_link_libraries(${TOMAHAWK_APPLICATION_TARGET} Qt5::WinExtras)
182182
endif()
183+
if( UNIX AND NOT APPLE )
184+
target_link_libraries(${TOMAHAWK_APPLICATION_TARGET} Qt5::DBus)
185+
endif()
183186

184187
MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )
185188

thirdparty/libportfwd/third-party/miniupnpc-1.6/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ endif (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED)
107107
if (UPNPC_BUILD_STATIC)
108108
add_library (upnpc-static STATIC ${MINIUPNPC_SOURCES})
109109
set_target_properties (upnpc-static PROPERTIES OUTPUT_NAME "miniupnpc")
110-
target_link_libraries (upnpc-static ${LDLIBS})
110+
target_link_libraries (upnpc-static PRIVATE ${LDLIBS})
111111
set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-static)
112112
set (UPNPC_LIBRARY_TARGET upnpc-static)
113113
endif (UPNPC_BUILD_STATIC)
@@ -117,7 +117,7 @@ if (UPNPC_BUILD_SHARED)
117117
set_target_properties (upnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc")
118118
set_target_properties (upnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION})
119119
set_target_properties (upnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION})
120-
target_link_libraries (upnpc-shared ${LDLIBS})
120+
target_link_libraries (upnpc-shared PRIVATE ${LDLIBS})
121121
set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-shared)
122122
set (UPNPC_LIBRARY_TARGET upnpc-shared)
123123
endif (UPNPC_BUILD_SHARED)

thirdparty/qxt/qxtweb-standalone/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ ADD_LIBRARY( qxtweb-standalone STATIC
7171
${sources}
7272
)
7373

74-
target_link_libraries( qxtweb-standalone Qt5::Network)
74+
target_link_libraries( qxtweb-standalone PUBLIC
75+
Qt5::Network
76+
)
77+
7578

7679
set_target_properties( qxtweb-standalone PROPERTIES AUTOMOC TRUE )

0 commit comments

Comments
 (0)