Open alex-fu27 opened 1 year ago
Sorry about that - I have a cmake-centric workflow and this (and many other) defines are configured as part of the CMake export interface (output here https://github.com/stevenlovegrove/Pangolin/blob/master/cmake/PangolinConfig.cmake.in#L6).
Since the library is split into many components, it saves me from having a seperate config.h.in file for each component, but I see it would cause problems for non-cmake users. I'm not sure what the most elegant solution is here. A workaround is to use CMake, but that won't suit everyone.
Sorry about that - I have a cmake-centric workflow and this (and many other) defines are configured as part of the CMake export interface (output here https://github.com/stevenlovegrove/Pangolin/blob/master/cmake/PangolinConfig.cmake.in#L6).
Since the library is split into many components, it saves me from having a seperate config.h.in file for each component, but I see it would cause problems for non-cmake users. I'm not sure what the most elegant solution is here. A workaround is to use CMake, but that won't suit everyone.
hi,steven .thanks to your nice code. and i use cmake 3.16 and the latest branch of pangolin ,it appears the kind of error "undefined gl***" above.hope you can check this problem. the HAVE_GLEW defined in PangolinTargets.cmake seems not work .i defined it in my CMakeList.txt of my program to solve this tempararily..
Steps: I cloned the repo, built Pangolin from source. GLEW is found correctly,
I built with
ninja -v
and-DHAVE_GLEW
is correctly passed to the compiler.I then created the following
test.cpp
:and tried to compile with
gcc -Wfatal-errors -Idest/usr/local/include test.cpp
:This is because nothing sets
HAVE_GLEW
in that case and inglplatform.h
:is conditional.
For most other users it might work because
-DHAVE_GLEW
for other reasons,GL/glew.h
before they includepangolin.h
,GL/gl.h
for some reasons which can be the case on some systems.The first two can be used as a workaround.