In my product, we have a C++ library which depends on a library produced by Graal VM’s native-image
tool. Effectively, a binary-only dependency. We build that from a set of Java sources.
I can get CMake to correctly build and link my C++ library with the native image library, and install both libraries and their headers, and even generate a tarball containing everything using CPack.
What I want to do is make it possible for users of the library to grab the CPack produced tarball and easily import it into their CMake-based project. The generated .cmake
files mean I can import and add the library to a project, but the native-image-produced library, which is an IMPORTED library in our build, is not included in those .cmake
s, and so the build fails because enough info is there for CMake to specify that the native-image-produced targets should be linked, but no more.
Once I can make it work I can look at making the whole thing usable with find_package()
, but that feels like a problem for later.
Has anyone tried this, or something like it? Because all the parts here produced by me in some form, it feels like there ought to be the scope to make this work. I’d rather not create one of these exported .cmake
files by hand, but at the moment that feels like the least stupid way.
Thanks!