[CMake] CMake 2.6.0 RC 10 ready for testing

Bill Hoffman bill.hoffman at kitware.com
Fri May 2 11:28:14 EDT 2008


Stefan wrote:
> Perhaps there is a small bug.
> 
> If I build Test with and within Visual Studio 2008 there will be every time
> the wrong build name "Win32-vs8". It have to be "Win32-vs9".
> 
OK, I see it, that is a bug in Modules/CTest.cmake.

I have checked in a fix:

$ cvs -q diff CTest.cmake
Index: CTest.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CTest.cmake,v
retrieving revision 1.11
diff -r1.11 CTest.cmake
13a14,25
 > # function to turn generator name into a version string
 > # like vs7 vs71 vs8 vs9
 > FUNCTION(GET_VS_VERSION_STRING generator var)
 >   STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" 
NUMBER "${generator}")
 >   IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
 >     SET(ver_string "vs71")
 >   ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
 >     SET(ver_string "vs${NUMBER}")
 >   ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
 >   SET(${var} ${ver_string} PARENT_SCOPE)
 > ENDFUNCTION(GET_VS_VERSION_STRING)
 >
174,182c186
<       IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$")
<         SET(DART_CXX_NAME "vs70")
<       ELSE(CMAKE_GENERATOR MATCHES "^Visual Studio 7$")
<         IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$")
<           SET(DART_CXX_NAME "vs71")
<         ELSE(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$")
<           SET(DART_CXX_NAME "vs8")
<         ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$")
<       ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$")
---
 >       GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)

hoffman at CORRIN ~/My Builds/CMake/Modules
$ cvs commit -m "ENH: recognize vs 9 and possible 10 or greater when 
they come out..." CTest.cmake
/cvsroot/CMake/CMake/Modules/CTest.cmake,v  <--  CTest.cmake
new revision: 1.12; previous revision: 1.11

> The TotalVirtualMemory and TotalPhysicalMemory is also wrong. I have 3GB
> Physical Memory, but perhaps that could be a problem with Vista Business.
> 


Not sure what is wrong with the memory...

The code for that is here:
   MEMORYSTATUS ms;
   GlobalMemoryStatus(&ms);

   unsigned long tv = ms.dwTotalVirtual;
   unsigned long tp = ms.dwTotalPhys;
   unsigned long av = ms.dwAvailVirtual;
   unsigned long ap = ms.dwAvailPhys;
   this->TotalVirtualMemory = tv>>10>>10;
   this->TotalPhysicalMemory = tp>>10>>10;
   this->AvailableVirtualMemory = av>>10>>10;
   this->AvailablePhysicalMemory = ap>>10>>10;
   return 1;

If you have a fix great if not, I can live with this in 2.6.0.

Thanks.

-Bill


More information about the CMake mailing list