draco: Improve installation and packaging support. by tomfinegan · Pull Request #775 · google/draco (original) (raw)
I'll be happy to review a PR that adds the above, but the recommendation at present remains building from source. Short of that the find_package setup is known to work-- if you have a configuration that does not work, please file an issue that includes reproduction steps.
Moreover current config file makes installed package non-relocatable I think:
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#generating-a-package-configuration-file
As suggested in the linked document the draco config file is populated via configure_package_config_file(), and should be relocatable. Again, please file an issue if you have a reproducible problem.
Note that what you're asking for largely exists at present using the current config file. As demonstrated in the install test, which uses the config file with find_package():
https://github.com/google/draco/blob/master/src/draco/tools/install_test/CMakeLists.txt
It does use a variable to determine the name of the library to link, but that does not seem that onerous. The rest of the noise in there is required to handle platform specific hassles (e.g. rpath on MacOS).