Skip to content

Commit

Permalink
Fix CMake module base filename
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bbrown105 committed Jun 28, 2024
1 parent 86628f7 commit 4255a4e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install(TARGETS example
NAMELINK_COMPONENT libexample-dev
)
install(EXPORT example
FILE example-config.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/example"
COMPONENT libexample-dev
NAMESPACE example::
Expand Down

0 comments on commit 4255a4e

Please sign in to comment.