BUG: Fix previous registry lookup change for executables.
- The target platform does not matter for finding executables so find_program should expand to both 32-bit and 64-bit registry values. - See issue #7095.
This commit is contained in:
parent
41ceabb60f
commit
3571198ea8
@ -478,14 +478,21 @@ void cmFindBase::ExpandRegistryAndCleanPath(std::vector<std::string>& paths)
|
|||||||
// We should view the registry as the target application would view
|
// We should view the registry as the target application would view
|
||||||
// it.
|
// it.
|
||||||
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_Default;
|
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_Default;
|
||||||
|
cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_Default;
|
||||||
{
|
{
|
||||||
if(const char* psize =
|
if(const char* psize =
|
||||||
this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
|
this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
|
||||||
{
|
{
|
||||||
switch(atoi(psize))
|
switch(atoi(psize))
|
||||||
{
|
{
|
||||||
case 4: view = cmSystemTools::KeyWOW64_32; break;
|
case 4:
|
||||||
case 8: view = cmSystemTools::KeyWOW64_64; break;
|
view = cmSystemTools::KeyWOW64_32;
|
||||||
|
other_view = cmSystemTools::KeyWOW64_64;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
view = cmSystemTools::KeyWOW64_64;
|
||||||
|
other_view = cmSystemTools::KeyWOW64_32;
|
||||||
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -497,8 +504,17 @@ void cmFindBase::ExpandRegistryAndCleanPath(std::vector<std::string>& paths)
|
|||||||
for(i = paths.begin();
|
for(i = paths.begin();
|
||||||
i != paths.end(); ++i)
|
i != paths.end(); ++i)
|
||||||
{
|
{
|
||||||
cmSystemTools::ExpandRegistryValues(*i, view);
|
std::string expanded = *i;
|
||||||
cmSystemTools::GlobDirs(i->c_str(), finalPath);
|
cmSystemTools::ExpandRegistryValues(expanded, view);
|
||||||
|
cmSystemTools::GlobDirs(expanded.c_str(), finalPath);
|
||||||
|
if(view != other_view && expanded != *i &&
|
||||||
|
this->CMakePathName == "PROGRAM")
|
||||||
|
{
|
||||||
|
// Executables can be either 32-bit or 64-bit.
|
||||||
|
expanded = *i;
|
||||||
|
cmSystemTools::ExpandRegistryValues(expanded, other_view);
|
||||||
|
cmSystemTools::GlobDirs(expanded.c_str(), finalPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// clear the path
|
// clear the path
|
||||||
paths.clear();
|
paths.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user