summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-27 20:50:04 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-27 20:50:04 (GMT)
commit3571198ea832a741dfe80c566a206e9de140fbdd (patch)
tree7a290a1abbbe3c380c7a6ee0366884cb72631422 /Source/cmFindBase.cxx
parent41ceabb60ff38b828f3bbbf120734894a9f1e6dd (diff)
downloadCMake-3571198ea832a741dfe80c566a206e9de140fbdd.zip
CMake-3571198ea832a741dfe80c566a206e9de140fbdd.tar.gz
CMake-3571198ea832a741dfe80c566a206e9de140fbdd.tar.bz2
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.
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index cff55ee..8d519bc 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -478,14 +478,21 @@ void cmFindBase::ExpandRegistryAndCleanPath(std::vector<std::string>& paths)
// We should view the registry as the target application would view
// it.
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_Default;
+ cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_Default;
{
if(const char* psize =
this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
{
switch(atoi(psize))
{
- case 4: view = cmSystemTools::KeyWOW64_32; break;
- case 8: view = cmSystemTools::KeyWOW64_64; break;
+ case 4:
+ view = cmSystemTools::KeyWOW64_32;
+ other_view = cmSystemTools::KeyWOW64_64;
+ break;
+ case 8:
+ view = cmSystemTools::KeyWOW64_64;
+ other_view = cmSystemTools::KeyWOW64_32;
+ break;
default: break;
}
}
@@ -497,8 +504,17 @@ void cmFindBase::ExpandRegistryAndCleanPath(std::vector<std::string>& paths)
for(i = paths.begin();
i != paths.end(); ++i)
{
- cmSystemTools::ExpandRegistryValues(*i, view);
- cmSystemTools::GlobDirs(i->c_str(), finalPath);
+ std::string expanded = *i;
+ 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
paths.clear();