diff mbox series

[v2] kernel-shark: Use cmake imported targets instead of variables

Message ID 20220113124322.292222-1-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Commit cb4ed5ebe5fd64d27d45140200d2aa5af0bc932f
Headers show
Series [v2] kernel-shark: Use cmake imported targets instead of variables | expand

Commit Message

Tzvetomir Stoyanov (VMware) Jan. 13, 2022, 12:43 p.m. UTC
Using cmake imported targets instead of package variables is
recommended way to define package dependencies.

The GLUT_LIBRARY cmake variable was renamed in cmake 3.22.1, which
breaks the Kernel Shark build with the latest cmake.

Reported-by: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 src/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michal Sojka Jan. 15, 2022, 4:54 p.m. UTC | #1
Hi Tzvetomir and Yordan,

I'm not sure my sign-off is necessary, but if Yordan wants it, you have
it :-)

Cheers,
-Michal

On Thu, Jan 13 2022, Tzvetomir Stoyanov (VMware) wrote:
> Using cmake imported targets instead of package variables is
> recommended way to define package dependencies.
>
> The GLUT_LIBRARY cmake variable was renamed in cmake 3.22.1, which
> breaks the Kernel Shark build with the latest cmake.
>
> Reported-by: Michal Sojka <michal.sojka@cvut.cz>
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>

Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>

> ---
>  src/CMakeLists.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index babb9c1..9e0b4ae 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -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
> -- 
> 2.34.1
diff mbox series

Patch

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index babb9c1..9e0b4ae 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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