Skip to contentSkip to conversation

kernel-shark: Use cmake imported targets instead of variables

PATCH Superseded Tzvetomir Stoyanov (VMware) 2 participants 2 messages Jan 12, 2022 – Jan 13, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-shark: Use cmake imported targets instead of variables

Using cmake imported targets instead of package variables is recommended way to define package dependencies.

---
 src/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/CMakeLists.txt +2 -2
index babb9c1..9e0b4ae 100644
@@ -59,8 +59,8 @@ if (OPENGL_FOUND)
                                      KsPlugins.cpp)
 
     target_link_libraries(kshark-plot  kshark
-                                       ${GLUT_LIBRARY}
-                                       ${OPENGL_LIBRARIES})
+                                       GLUT::GLUT
+                                       OpenGL::GLU)
 
     set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
     install(TARGETS kshark-plot
Signature · 1 line
2.33.1
#1 lore raw
Quoted 3 lines · Tzvetomir Stoyanov (VMware)

Using cmake imported targets instead of package variables is recommended way to define package dependencies.

Hi Ceco,

Please add to the commit message an explanation, clarifying that this patch actually fixes a build failure. You may take as example the message of the patch sent by Michal
https://lore.kernel.org/all/[email protected]/

Michal and Ceco,
I will be happy to see this patch signed by both of you.

thanks,
Yordan

Quoted 21 lines
---
  src/CMakeLists.txt | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
src/CMakeLists.txt +2 -2
index babb9c1..9e0b4ae 100644
@@ -59,8 +59,8 @@ if (OPENGL_FOUND)
                                       KsPlugins.cpp)
 
      target_link_libraries(kshark-plot  kshark
-                                       ${GLUT_LIBRARY}
-                                       ${OPENGL_LIBRARIES})
+                                       GLUT::GLUT
+                                       OpenGL::GLU)
 
      set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
      install(TARGETS kshark-plot