oink
oink copied to clipboard
The target "oink" links to: lace::lace but the target was not found
This is because the build is done on an unconnected system where FetchContent doesn't work.
The correct way is to add it as git submodule, so that it would be downloaded upfront.
I admit the current solution is incorrect. Adding as a submodule is also incorrect.
The problem is that Knor inherits Lace from Oink, and from Sylvan. So it would compile Lace twice.
By the way using FetchContent kind of solves the multiple dependency issue but it introduces other problems including requiring internet to compile.
I have been thinking about using other ways to work with dependencies. I would prefer to avoid OS provided dependency frameworks and use something like Conan, but I have not yet found a good way to do this that works well with CMake and can also be used by others who don't use Conan.
I would prefer to avoid OS provided dependency frameworks ...
This isn't a sustainable approach. If every package would be fetching and installing its dependencies compilation time would increase exponentially with number/size of installed packages. Using external package manager is the only sustainable solution.
I have now revised this.
To find lace, first the script tries to see if lace is already a target, for example if Oink is used as a subproject in a project that already has lace. Then, the script uses find_package to see if lace is already in the system. If both options fail, the script uses FetchContent to obtain lace.
I may consider going back to the "old" way of doing things by having a git submodule with Lace in it. I thought FetchContent is a neat solution but it's just not supported enough.l
BTW the idea with FetchContent is that you don't get exponential compilation time because FetchContent can also do "find_package" but only from a certain CMake version (which not all systems have) and FetchContent in a larger project can figure out what dependencies it needs. But again, not supported very well.