[Cmake-commits] [cmake-commits] king committed cmGetFilenameComponentCommand.cxx 1.22 1.23

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Sep 30 13:45:26 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv7659/Source

Modified Files:
	cmGetFilenameComponentCommand.cxx 
Log Message:
Fix get_filename_component() registry view

Some find-modules use get_filename_component() to expand registry
values.  We need to look in both the 32-bit and 64-bit registry views
when expanding values.  We prefer the one that the target application
would see.  See issue #8792.


Index: cmGetFilenameComponentCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetFilenameComponentCommand.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -C 2 -d -r1.22 -r1.23
*** cmGetFilenameComponentCommand.cxx	28 Sep 2009 15:42:40 -0000	1.22
--- cmGetFilenameComponentCommand.cxx	30 Sep 2009 17:45:24 -0000	1.23
***************
*** 36,40 ****
    std::string result;
    std::string filename = args[1];
!   cmSystemTools::ExpandRegistryValues(filename);
    std::string storeArgs;
    std::string programArgs;
--- 36,60 ----
    std::string result;
    std::string filename = args[1];
!   if(filename.find("[HKEY") != filename.npos)
!     {
!     // Check the registry as the target application would view it.
!     cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_32;
!     cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_64;
!     if(this->Makefile->PlatformIs64Bit())
!       {
!       view = cmSystemTools::KeyWOW64_64;
!       other_view = cmSystemTools::KeyWOW64_32;
!       }
!     cmSystemTools::ExpandRegistryValues(filename, view);
!     if(filename.find("/registry") != filename.npos)
!       {
!       std::string other = args[1];
!       cmSystemTools::ExpandRegistryValues(other, other_view);
!       if(other.find("/registry") == other.npos)
!         {
!         filename = other;
!         }
!       }
!     }
    std::string storeArgs;
    std::string programArgs;



More information about the Cmake-commits mailing list