eli-schwartz commented on issue #36411: URL: https://github.com/apache/arrow/issues/36411#issuecomment-2727532052
> I think that this question means whether `meson install` can install `XXXConfig.cmake` or not (downstream projects can find a project by `find_package(XXX)` or not). I think that this question doesn't mean `ExternalProject` nor `FetchContent`. > > Meson has a feature that generates `XXXConfig.cmake`: https://mesonbuild.com/CMake-module.html#cmakeconfigure_package_config_file > > But it didn't work well when I tried it for Apache Arrow GLib. (It may work well now.) From memory, cmake "needs" multiple files here, depending on how you set things up: - FindXXX.cmake -- standalone, handwritten lookups - XXXConfig.cmake paired with XXXTargets.cmake, the former is equivalent to the `Version:` field of a pkg-config file while the latter is equivalent to the `Libs:` and `Cflags:` fields cmake comes with a template for the former and meson can help you install that. Generating the latter is apparently incredibly complex as no template exists, not even for simple cases, though I suspect the majority of the cmake complexity could be simplified to "discover the library by pinning the install `libdir` location in the generated file, using find_library() to detect the library in that location, and setting it as the interface property". I'm not averse to adding this, although it should also be possible to write a simple one by hand. I suspect, but am not sure, that the person who added support to meson for generating `XXXConfig.cmake`, figured that everyone would want to handwrite the Targets file anyway. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
