FindGLUT: Use link directories for libs from pkg-config

Since commit f90d15458a (FindGLUT: Use pkg-config to find flags if
available, 2021-06-11, v3.22.0-rc1~469^2), the `GLUT_LIBRARIES` may come
from `pkg-config`, in which case they may be `-l` flags instead of
absolute paths.  Propagate `GLUT_LIBRARY_DIRS` to GLUT::GLUT too.

Fixes: #23229
This commit is contained in:
Silvio Traversaro
2022-02-15 08:23:11 -05:00
committed by Brad King
parent a16cefeafe
commit 44f7238d5d
+3
View File
@@ -55,6 +55,9 @@ function(_add_glut_target_simple)
if(GLUT_LIBRARIES)
target_link_libraries(GLUT::GLUT INTERFACE ${GLUT_LIBRARIES})
endif()
if(GLUT_LIBRARY_DIRS)
target_link_directories(GLUT::GLUT INTERFACE ${GLUT_LIBRARY_DIRS})
endif()
if(GLUT_LDFLAGS)
target_link_options(GLUT::GLUT INTERFACE ${GLUT_LDFLAGS})
endif()