34 lines
959 B
Diff
34 lines
959 B
Diff
|
From e1b67d0373b3cdc8e53836601b9b0f6372f84e70 Mon Sep 17 00:00:00 2001
|
||
|
From: Brad King <brad.king@kitware.com>
|
||
|
Date: Wed, 26 Apr 2017 08:14:08 -0400
|
||
|
Subject: [PATCH] FindGLUT: Add library dependencies only if they exist
|
||
|
|
||
|
Fixes: #14060
|
||
|
---
|
||
|
Modules/FindGLUT.cmake | 8 +++++---
|
||
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
|
||
|
index 02e6df037..88d4b2918 100644
|
||
|
--- a/Modules/FindGLUT.cmake
|
||
|
+++ b/Modules/FindGLUT.cmake
|
||
|
@@ -120,10 +120,12 @@ if (GLUT_FOUND)
|
||
|
# If not, we need some way to figure out what platform we are on.
|
||
|
set( GLUT_LIBRARIES
|
||
|
${GLUT_glut_LIBRARY}
|
||
|
- ${GLUT_Xmu_LIBRARY}
|
||
|
- ${GLUT_Xi_LIBRARY}
|
||
|
- ${GLUT_cocoa_LIBRARY}
|
||
|
)
|
||
|
+ foreach(v GLUT_Xmu_LIBRARY GLUT_Xi_LIBRARY GLUT_cocoa_LIBRARY)
|
||
|
+ if(${v})
|
||
|
+ list(APPEND GLUT_LIBRARIES ${${v}})
|
||
|
+ endif()
|
||
|
+ endforeach()
|
||
|
|
||
|
if(NOT TARGET GLUT::GLUT)
|
||
|
add_library(GLUT::GLUT UNKNOWN IMPORTED)
|
||
|
--
|
||
|
2.11.1
|
||
|
|