From 41ceabb60ff38b828f3bbbf120734894a9f1e6dd Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 27 May 2008 14:47:46 -0400 Subject: BUG: Fix registry lookups for FIND commands to use view of target platform. - See issue #7095. --- Source/cmFindBase.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index c4f380e..cff55ee 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -475,6 +475,21 @@ void cmFindBase::AddCMakeSystemVariables() void cmFindBase::ExpandRegistryAndCleanPath(std::vector& paths) { + // We should view the registry as the target application would view + // it. + cmSystemTools::KeyWOW64 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; + default: break; + } + } + } std::vector finalPath; std::vector::iterator i; // glob and expand registry stuff from paths and put @@ -482,7 +497,7 @@ void cmFindBase::ExpandRegistryAndCleanPath(std::vector& paths) for(i = paths.begin(); i != paths.end(); ++i) { - cmSystemTools::ExpandRegistryValues(*i); + cmSystemTools::ExpandRegistryValues(*i, view); cmSystemTools::GlobDirs(i->c_str(), finalPath); } // clear the path -- cgit v0.12