nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.58k stars 608 forks source link

Failed to find some files when using CMake to configure the project. #364

Closed hwhsu1231 closed 1 year ago

hwhsu1231 commented 1 year ago

Descriptions

I want to use CMake to compile the source codes to install GLEW. However, it failed. It seems that it couldn't find the following files:

C:/ccxxpkgs/source/glew-2.2.0/src/glewinfo.c
C:/ccxxpkgs/source/glew-2.2.0/include/GL/wglew.h
C:/ccxxpkgs/source/glew-2.2.0/build/visualinfo.rc

However, after searching the whole project, I found that there don't exist those files. What happened?

Steps of Installation

Click to expand 1. Download and unzip the source code. [glew-2.2.0.zip](https://github.com/nigels-com/glew/archive/refs/tags/glew-2.2.0.zip) 2. Open Windows Terminal (`cmd.exe`) and change to the project folder. ``` cd glew-2.2.0 cd build ``` 3. call `vcvarsall.bat x64` to preload the MSVC environment. ``` vcvarsall x64 ``` 4. Create the build folder and change into it. ``` md build-msvc16-x64 cd build-msvc16-x64 ``` 5. Configure the project with the generator `Ninja Multi-Config`. ``` cmake ../cmake -G"Ninja Multi-Config" ```

Logs

Click to expand ```cmd C:\ccxxpkgs\source\glew-2.2.0>cd build C:\ccxxpkgs\source\glew-2.2.0\build>md build-msvc16-x64 C:\ccxxpkgs\source\glew-2.2.0\build>cd build-msvc16-x64 C:\ccxxpkgs\source\glew-2.2.0\build\build-msvc16-x64>vcvarsall x64 ********************************************************************** ** Visual Studio 2019 Developer Command Prompt v16.11.16 ** Copyright (c) 2021 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' C:\ccxxpkgs\source\glew-2.2.0\build\build-msvc16-x64>cmake ../cmake -G"Ninja Multi-Config" -- The C compiler identification is MSVC 19.29.30145.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Found OpenGL: opengl32 -- Configuring done CMake Error at CMakeLists.txt:183 (add_executable): Cannot find source file: C:/ccxxpkgs/source/glew-2.2.0/src/glewinfo.c Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at CMakeLists.txt:107 (add_library): Cannot find source file: C:/ccxxpkgs/source/glew-2.2.0/include/GL/wglew.h Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at CMakeLists.txt:197 (add_executable): Cannot find source file: C:/ccxxpkgs/source/glew-2.2.0/build/visualinfo.rc Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at CMakeLists.txt:183 (add_executable): No SOURCES given to target: glewinfo CMake Error at CMakeLists.txt:107 (add_library): No SOURCES given to target: glew CMake Error at CMakeLists.txt:111 (add_library): No SOURCES given to target: glew_s CMake Error at CMakeLists.txt:197 (add_executable): No SOURCES given to target: visualinfo CMake Generate step failed. Build files cannot be regenerated correctly. ```
nigels-com commented 1 year ago

See Issue #363