How to use CMAKE_MODULE_PATH correctly on windows

2019-06-26 03:05发布

问题:

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.

回答1:

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.



标签: cmake