[CMake] Building both make files and visual studio files.

Sylvain Benner benner at virtools.com
Mon Oct 1 10:52:11 EDT 2007


> How do you go about setting the platformname from within the CMakeLists.txt?  I had a look at the code, but concluded that it wasn't configurable.  Is that another local hack?
Actually in the global generator we added a "RealPlatformName" AND a 
"Platform" members.

We pass a custom "PLATFORM" variable to cmake on the command line, like 
this:

cmake.exe -G "Some Generator" -D -D "PLATFORM:STRING=Win32_Dynamic"

Then in the top level CMakeLists.txt we set the "real" platform name.

IF(PLATFORM MATCHES "Win32" OR PLATFORM MATCHES "PS3")
    SET(PLATFORM_REAL_CONFIGNAME "Win32")
ENDIF(PLATFORM MATCHES "Win32" OR PLATFORM MATCHES "PS3")

in our custom generator, we get these variables like this:

this->Makefile->GetRequiredDefinition("PLATFORM");
this->Makefile->GetRequiredDefinition("PLATFORM_REAL_CONFIGNAME");

--Sylvain


More information about the CMake mailing list