diff options
author | Silvio Traversaro <pegua1@gmail.com> | 2022-02-15 13:23:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-15 15:35:11 (GMT) |
commit | 44f7238d5d542afac860be928fa215c0f3f9a8fb (patch) | |
tree | edeb5666215aaf9d04bc7f6470fca11b1b6abec0 /Modules/FindGLUT.cmake | |
parent | a16cefeafe4a043b94675a1eaf7d51c24e51ecd3 (diff) | |
download | CMake-44f7238d5d542afac860be928fa215c0f3f9a8fb.zip CMake-44f7238d5d542afac860be928fa215c0f3f9a8fb.tar.gz CMake-44f7238d5d542afac860be928fa215c0f3f9a8fb.tar.bz2 |
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
Diffstat (limited to 'Modules/FindGLUT.cmake')
-rw-r--r-- | Modules/FindGLUT.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index 636f1ea..9c80ad7 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -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() |