glew
glew copied to clipboard
Missing source files and incorrect CMakeLists.txt lead to failed project configuration
I have a top-level project that does the following call to glew
git submodule:
add_subdirectory(deps/glew/build/cmake)
For now I am excluding the importing of GLEW::glew
(include(deps/glew/build/cmake/glew-config.cmake)
) due to the fact that the call above yields an error.
-- Configuring done
CMake Error at deps/glew/build/cmake/CMakeLists.txt:205 (add_executable):
Cannot find source file:
...
It goes on and on listing various GLEW source files. I printed out ${GLEW_DIR}
inside the CMakeLists.txt
right after it is defined and it revealed the following value:
/home/USER/Projects/Eclipse/workspace1/PROJECT/deps/glew/build/cmake/../..
This means that GLEW_DIR
is pointing (in my case) at [...]/deps/glew
. In itself this is correct since the variable is supposed to point at the root directory of the GLEW project. However anything with ${GLEW_DIR}/src/*.c
leads to an obvious error since. I have checked out master
branchthere is but one source file in
srcdirectory namely
visualinfo.c. All other source files are in
auto/src` directory.
But that is not the only issue. I saw glew.c
being added. However I am unable (with the call ls -R | grep glew.c
) to find a single source file with that name. Since I don't see this file being generated (smae applies to glewinfo.c
) I assume that the file is missing.
For the purpose of a git submodule, I'd recommend using: Perlmint/glew-cmake rather than this upstream repository.
The long standing policy here is to maintain the history of the GLEW code generators, but not the corresponding history of the generated code. The general advice is to use the current GLEW release, rather than the in-progress master branch.
I do appreciate that this arrangement is old-fashioned, but indeed GLEW has been around for a good long while.