beman-project / exemplar

Example Beman project
Other
10 stars 16 forks source link

Fix CMake module base filename #13

Closed bretbrownjr closed 4 months ago

bretbrownjr commented 4 months ago

This patch renames example.cmake to example-config.cmake. This fixes a bug in which find_package(example) fails to locate the CMake module shipped by this project.

See the upstream CMake documentation for find_package for details about which file basenames are accepted when searching for a CMake modules via find_package, but names like example.cmake are not on the search path and will not be discovered properly.

Using example-config.cmake resolves this issue.

bretbrownjr commented 4 months ago

This sort of bug is difficult to test meaningfully inside the repo. It generally shows up when using this library from another project via packaging. I am working on Conan support in https://github.com/beman-project/beman/pull/21, which is how this bug was discovered.