What is the proper way to modify this variable so that CMake can find the appropriate modules that projects specify as requirements? It seems to be autogenerated and I cannot find environment variables that would modify this path in any way. I also am hard pressed to find documentation that explains this well; only instructions to "install" CMake packages with no details on how exactly that can be accomplished.
For find_package CMake offers a special mechanism on Windows called the package registry. CMake maintains a list of package information in the Windows registry under HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\ . Packages build from source can register there using the export command.
Semicolon-separated list of directories specifying a search path for CMake modules to be loaded by the include() or find_package() commands before checking the default modules that come with CMake. By default it is empty, it is intended to be set by the project.
A module is defined with CMake scripts that inform the build system of its contents and dependencies. The modularization effort significantly improves the extensibility of the toolkit and lowers the barrier to contribution. Modules are organized into: The top level directory.
You can extend or set the module path like so:
list(APPEND CMAKE_MODULE_PATH "some path to modules")
or:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "path")
Just like you can any other (list) variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With