diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-05-01 17:31:17 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-05-13 15:19:27 +0200 |
| commit | bc63ea7629c8c3c4248a777d1c0325ae800556e0 (patch) | |
| tree | 257e30371623a35d8b7fb92e9abf83ce7cf8b856 /CMake | |
| parent | d1ea57bc7a04ea611dec555ca310d5e572a4b60e (diff) | |
CMake: improve linking OpenGL3 example programs (#959)
- Remove find_library(LIB_GLEW ...) from 'resources.cmake'
- Use the variable FLTK_GLEW_DIR to "find" a user supplied GLEW library
for OpenGL3 example programs (examples/OpenGL3*.cxx).
Both static and shared libs (DLLs) are supported, but the static
library is preferred to avoid DLL dependencies.
- Define preprocessor macro 'GLEW_STATIC' by CMake compile definitions
if and only if the static glew library (glew32s) was found and linked.
The previous code defined 'GLEW_STATIC' unconditionally in the source
code which led to undefined references if a shared lib (DLL) was used.
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/resources.cmake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/CMake/resources.cmake b/CMake/resources.cmake index 3fd8205f1..eaea18c07 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -152,14 +152,13 @@ endif((NOT APPLE) OR FLTK_BACKEND_X11) find_library(LIB_freetype freetype) find_library(LIB_GL GL) find_library(LIB_MesaGL MesaGL) -find_library(LIB_GLEW NAMES GLEW glew32) find_library(LIB_jpeg jpeg) find_library(LIB_png png) find_library(LIB_zlib z) find_library(LIB_m m) mark_as_advanced(LIB_dl LIB_fontconfig LIB_freetype) -mark_as_advanced(LIB_GL LIB_MesaGL LIB_GLEW) +mark_as_advanced(LIB_GL LIB_MesaGL) mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) mark_as_advanced(LIB_m) |
