-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems using CMake on Windows #174
Comments
Thanks for the comprehensive description of your problem - I will have to look into this and try to reproduce this issue. @sfuller maybe you can help me look into this? |
Thanks for the quick reply! I think I might be closer to a solution now. I think that instead of running msbuild on the output of glad cmake, I should be running |
Did you figure this out? Sorry busy at the moment, I'll try to take a look at the weekend again. |
No problem. We did not track this all the way down to a workable solution, and we had to move on to other things. So for now we are just going to incorporate the pre-generated .h/.c files directly into our build, rather than go through glad's CMake mechanism. If we revisit in the future I will update this issue. Thanks again for your help. |
Hello everyone. @tysonbrochu , have you considered to try FetchContent module instead of cloning glad manually? My suggestion is to give it a shot. It may solve the issue you have (you let CMake handle everything for you). Plus, you can manage other dependencies is the same unified way.
Hope this helps. |
Hi, sorry I'm late to this conversation. Note, that you will need to run |
I assume this is solved, if not feel free to re-open. |
Hello,
I'm having trouble getting glad working with CMake on Windows. I would like to have glad run as part of our CMake build process, and use the generated glad.h/lib files in our project.
For testing, my folder structure looks like:
C:\Users\me\projects\glad
(cloned from GitHub)C:\Users\me\projects\glad-driver
(new directory with nothing except a CMakeLists.txt)I made empty
build\
directories off of each of these as well.The contents of
glad-driver\CMakeLists.txt
are:Here are the commands I use to try to build glad-driver. First run CMake on glad:
Result:
Next, compile the generated Visual Studio projects:
Result:
(Lots of stuff then):
Last step, try finding glad with CMake’s
find_package
command:Result:
Further investigation reveals that the gladTargets.cmake file (and a bunch couple of seemingly related files are actually located at):
C:\Users\me\projects\glad\build\CMakeFiles\Export\lib\cmake\glad\gladTargets.cmake
I don’t know why
gladConfig.cmake
ends up inbuild
andgladTargets.cmake
ends up inbuild\CmakeFiles\Export\lib\cmake\glad
.If I copy
gladTargets.cmake
into theglad\build
directory and re-run CMake from glad-driver, then my glad-driver CMake project does succeed. However if I add the following lines to glad-driver\CMakeLists.txt:then I get the following error:
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: