On Windows find_path searches only the first item of the CMAKE_PREFIX_PATH enviromental variable
CMake version : 3.7-beta2 .
I still need to prepare an self-contained example, but apparently if CMAKE_PREFIX_PATH
is an environment variable in Windows containing a list of directories, find_path
searches only in the <prefix>/include
of the first element of the list, rather then
<prefix>/include
for each<prefix>
inCMAKE_PREFIX_PATH
as documented in https://cmake.org/cmake/help/v3.7/command/find_path.html .
Note that if CMAKE_PREFIX_PATH
is instead a CMake variable defined in the command line, find_path
works as documented.
Given that in https://cmake.org/cmake/help/v3.7/command/find_path.html it is not specified if CMAKE_PREFIX_PATH
is the CMake variable or the environmental variable, this may be an intended behavior, even if it is inconvenient. If this is the case, the issue is that this should be properly documented in find_path
documentation.