Closed Roy-Fokker closed 7 months ago
Ooo. This is handy
Can we add this as the project CMake maybe?
Yes, you can do that. However, I don't think you need FIND_PACKAGE_ARGS NAME ...
on line 26 with method described in #308 as that will add no value.
That line is what enables user to call find_package(raylib_cpp)
. If you call fetchcontent inside CMakeLists.txt, raylib_cpp library is automagically made available.
The way I typically tend to manage 3rd party dependency is to look at VCPKG first, if it has it then download from there, if not then to look for *.cmake file within my project directory. This is mostly because I don't like dealing with git-sub-modules or having 3rd-party/external directories.
as example of using *.cmake & find_package combo:-
CMAKE_MODULE_PATH
variable.Now, please keep in mind, I am not a CMake expert, I just pretend to be one on the Internets :P But above described process works well for me as strictly consumer of a library.
Perhaps folks would like somewhat easier mechanism to consume this library.
I've hacked together a simple CMake module file as below:
FindRaylib_Cpp.cmake
This can then be consumed as:
CMakeLists.txt
If you configure
CMAKE_MODULE_PATH
within your project to be something like<project folder>/cmake/' and place the
FindRaylib_Cpp.cmake` with in it.CMake will find it, download the raylib-cpp src from github and make it available for use.
few caveats
FATAL_ERROR
if it hasn't been.Hopefully others find this useful. Sorry if this is not appropriate location for such.