I am trying to create a repository that will build and install Mesa 3D in a local directory. I have read that Mesa 3D needs to be configured using Meson but I would like both of these downloaded and built in the local directory of my repository. I am using CMake 3.22 and ninja instead of make.
I think the way to accomplish this would be to use CPMAddPackage or ExternalProject_Add (I am not picky) ?
I have been going around with this for a few days and am hoping one of you CMake experts has some direction to point me to. I am hoping there is a singleCMakeLists.txt file that I could create that could do this so that all I would need to do is run something like the following in the current directory of the local directory I am building:
It’s not trivial to extract, but Mesa and Meson are part of the common-superbuild which relies on ExternalProject_Add under the hood. The quick thing to do would be to just take the logic around superbuild_add_project, replace that call with ExternalProject_Add and include the relevant bits from versions.cmake then tweak from there. Other bits may break, but maybe you don’t need them (the superbuild does…other things to do some package management stuff).