I configure and package my library using CMake and CPack. I have written my own find-module: FindMyLib.cmake
.
How do I tell CMake/CPack to add this file to the CMake module directory, so that future developers can simply specify FIND_PACKAGE(MyLib)
to use my library?
You can set CMAKE_MODULE_PATH
and distribute your custom FindFoo.cmake
with your project. For example:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")