Skip to content

Commit

Permalink
Modernize cmake usage a little bit
Browse files Browse the repository at this point in the history
I haven't seen LINK_PRIVATE/LINK_PUBLIC in ages, they're deprecated in
favour of PRIVATE/PUBLIC, which exist since CMake 3.0 if I see
correctly. Also improve indentation.
  • Loading branch information
dfaure-kdab authored and Waqar144 committed Nov 13, 2023
1 parent 048b049 commit 740c652
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/kde/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(gammaray_kitemmodels_srcs

add_library(gammaray_kitemmodels SHARED ${gammaray_kitemmodels_srcs})

target_link_libraries(gammaray_kitemmodels LINK_PUBLIC Qt::Core)
target_link_libraries(gammaray_kitemmodels PUBLIC Qt::Core)

set_target_properties(gammaray_kitemmodels PROPERTIES
${GAMMARAY_DEFAULT_LIBRARY_PROPERTIES}
Expand Down
4 changes: 2 additions & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ target_include_directories(
)
target_link_libraries(
gammaray_client
LINK_PUBLIC
PUBLIC
Qt::Core
LINK_PRIVATE
PRIVATE
gammaray_ui
gammaray_ui_internal
gammaray_common
Expand Down
6 changes: 3 additions & 3 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ target_include_directories(
)
target_link_libraries(
gammaray_common
LINK_PUBLIC
PUBLIC
Qt::Core
LINK_PRIVATE
PRIVATE
Qt::Network
Qt::Gui
Qt::GuiPrivate
)
target_link_libraries(
gammaray_common
LINK_PRIVATE
PRIVATE
gammaray_lz4
gammaray_kitemmodels
${CMAKE_DL_LIBS}
Expand Down
10 changes: 5 additions & 5 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ target_include_directories(
)
target_link_libraries(
gammaray_core
LINK_PUBLIC
PUBLIC
gammaray_common
LINK_PRIVATE
PRIVATE
gammaray_common_internal
gammaray_kitemmodels
${CMAKE_DL_LIBS}
Expand All @@ -149,14 +149,14 @@ gammaray_set_rpath(gammaray_core ${LIB_INSTALL_DIR})

target_link_libraries(
gammaray_core
LINK_PUBLIC
PUBLIC
Qt::Core
LINK_PRIVATE
PRIVATE
Qt::Gui
Qt::GuiPrivate
)
if(TARGET Qt::AndroidExtras)
target_link_libraries(gammaray_core LINK_PRIVATE Qt::AndroidExtras)
target_link_libraries(gammaray_core PRIVATE Qt::AndroidExtras)
endif()

add_backward(gammaray_core)
Expand Down
10 changes: 5 additions & 5 deletions launcher/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ target_include_directories(
)
target_link_libraries(
gammaray_launcher
LINK_PUBLIC
PUBLIC
Qt::Core
LINK_PRIVATE
PRIVATE
gammaray_common
Qt::Network
${CMAKE_DL_LIBS}
)
if(HAVE_QT_WIDGETS)
target_link_libraries(gammaray_launcher LINK_PRIVATE Qt::Gui Qt::Widgets)
target_link_libraries(gammaray_launcher PRIVATE Qt::Gui Qt::Widgets)
endif()
if(WIN32)
target_link_libraries(gammaray_launcher LINK_PRIVATE version)
target_link_libraries(gammaray_launcher PRIVATE version)
elseif(APPLE)
target_link_libraries(gammaray_launcher LINK_PRIVATE "-framework CoreFoundation")
target_link_libraries(gammaray_launcher PRIVATE "-framework CoreFoundation")
endif()

install(
Expand Down
4 changes: 2 additions & 2 deletions launcher/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ target_include_directories(
)
target_link_libraries(
gammaray_launcher_ui
LINK_PUBLIC
PUBLIC
gammaray_launcher
LINK_PRIVATE
PRIVATE
Qt::Core
Qt::Concurrent
Qt::Gui
Expand Down
2 changes: 1 addition & 1 deletion plugins/signalmonitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library(
${gammaray_signalmonitor_shared_srcs}
)
target_link_libraries(
gammaray_signalmonitor_shared LINK_PRIVATE gammaray_common
gammaray_signalmonitor_shared PRIVATE gammaray_common
)
set_target_properties(gammaray_signalmonitor_shared PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_features(gammaray_signalmonitor_shared PUBLIC ${GAMMARAY_REQUIRED_CXX_FEATURES})
Expand Down
6 changes: 3 additions & 3 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ target_include_directories(

target_link_libraries(
gammaray_ui
LINK_PUBLIC
PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
gammaray_common
LINK_PRIVATE
PRIVATE
gammaray_common_internal
gammaray_kitemmodels
Qt::WidgetsPrivate
)
if(TARGET KF${QtCore_VERSION_MAJOR}::SyntaxHighlighting)
target_link_libraries(gammaray_ui LINK_PRIVATE KF${QtCore_VERSION_MAJOR}::SyntaxHighlighting)
target_link_libraries(gammaray_ui PRIVATE KF${QtCore_VERSION_MAJOR}::SyntaxHighlighting)
endif()

set(gammaray_ui_internal_srcs
Expand Down

0 comments on commit 740c652

Please sign in to comment.