FindMatlab failed to search for matlab installation from registry in win64
the reason is that FindMatlab failed to detect the proper system architecture and thus use the wrong reg type, refer to #L359:
if(${win64} AND ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "64")
set(APPEND_REG "/reg:64")
else()
set(APPEND_REG "/reg:32")
endif()
according to the doc(and verified of course), CMAKE_HOST_SYSTEM_PROCESSOR
is set to the value of the environment variable PROCESSOR_ARCHITECTURE
, which is AMD64
in win7 x64. so the ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "64"
would always fail, thus results in failure of the later registry key search.
well, i am not sure whether or not the value of CMAKE_HOST_SYSTEM_PROCESSOR
is set to AMD64
in all versions of win64 system, but the MATCHES
should be fixed or improved.
btw, the doc of FindMatlab could use some updates, for example, messages dealing with the variable MATLAB_VERSION
is no longer valid and should be removed.