ArthurSonzogni / OpenGL_CMake_Skeleton

:heart: A ready to use cmake skeleton using GLFW, Glew and glm. :+1:
https://arthursonzogni.com
MIT License
286 stars 45 forks source link

Some suggestions #10

Closed onurbingol closed 3 months ago

onurbingol commented 1 year ago

Hey @ArthurSonzogni,

Nice work on getting all these together. I appreciate it. I also have several personal templates like this, but my observation is that after some time, they become hard to maintain. Github just suggested your repository, and had a chance to browse the files. If it is not a problem for you, I'd like to make some suggestions:

  1. CMake minimum v3.1 seems very old. Just for a reference, Ubuntu 20.04 comes with CMake v3.16.3 and Ubuntu 18.04 with v3.10.2. I am aware that not everybody uses Ubuntu and for sure, it is possible to download and install any version of CMake from kitware.com. I just wanted to share these version numbers as a reference.
  2. Although it is perfectly fine to me, I see that some people around me find git extensions like submodules, lfs a bit confusing to use. Since you made a CMake skeleton, it feels like it might be a good idea to use more CMake-native methods: FetchContent or ExternalProject are perfectly suitable and good replacements for git-submodule.
  3. There is another CMake-integrated package manager that I sometimes use: vcpkg. It uses CMAKE_TOOLCHAIN_FILE variable, which could also be added to the top of CMakeLists.txt. It is a nice alternative, works on multiple platforms, too.
  4. You might also want to check FindOpenGL module and see if it could be useful in a skeleton.

Thanks again for your work!

ArthurSonzogni commented 3 months ago

Thanks for those nice words! BTW: after this template, I made SMK, that you might find useful.


Yes. It was written 9 years ago, which explain why some parts feels olds.

  1. ✅ Upgrading to v3.11 or any versions supporting FetchContent feels right to me.
  2. ✅ Migrating to FetchContent feels right to me.
  3. ⛔ Requiring VCPKG would decrease the amount of developers that could benefits this template.
  4. ⛔ I don't think FindOpenGL would be useful. This would try to use installed files, as opposed to the fetched ones (git submodule of FetchContent)

Happy to merge a PR if you want to make one.