[CMake] Changing VS2005 Configuration

Jakob Santner santner at icg.tu-graz.ac.at
Mon Oct 22 02:10:32 EDT 2007


Sylvain Benner schrieb:
> 
>> Hello,
>>
>> I am using Visual Studio 8 and cmake 2.4p7 and am trying to set the
>> configuration for a specific project to 'Release'. So I added
>>
>> SET(CMAKE_BUILD_TYPE Release)
>>
>> to CMakeLists.txt and ran cmake. The Visual Studio configuration manager
>> still lists all projects in 'Debug' configuration.
>>
>> What am I doing wrong?
>>   
> Hello,
> 
> You're doing nothing wrong. Current selected configuration is stored in
> the user file (.suo) which is a binary file. It is then impossible for
> CMake to generate this kind of parameter. But I guess you only need to
> set the default configuration only once because CMake won't overwrite
> the user file.
> 
> Otherwise if you don't need the other configuration types you can try
> the trick proposed by Josef.
> 
> --Sylvain
> 

Sylvain,

Josef's trick doesn't affect anything, I don't know why. Concerning your
answer: I don't think that it is then impossible for CMake to generate
this kind of parameter:

The solution file *.sln is a textfile which contains amongst others the
following lines:

[snip]
Project("{some_id}") = "_grabber", "_grabber.vcproj", "{another_id}"
	ProjectSection(ProjectDependencies) = postProject
		{third_id} = {third_id}
	EndProjectSection
EndProject
...
{another_id}.Debug|Win32.ActiveCfg = Debug|Win32
{another_id}.Debug|Win32.Build.0 = Debug|Win32
[/snip]

When I change the build-configuration using VS2005 the file is modified:

[snip]
{another_id}.Debug|Win32.ActiveCfg = Release|Win32
{another_id}.Debug|Win32.Build.0 = Release|Win32
[/snip]

When I run cmake from scratch and change these two terms manually with a
text editor, VS2005 starts in "Debug" configuration for the solution and
"Release" configuration for the specific project (just as desired).

What do you think about this?

BR

-- 
Jakob Santner
Institute for Computer Graphics and Vision (ICG)
GRAZ UNIVERSITY OF TECHNOLOGY
Inffeldgasse 16/II
A-8010 Graz, AUSTRIA

web: http://www.icg.tu-graz.ac.at/
mail: santner (at) icg.tu-graz.ac.at
tel: +43-650-4139160



More information about the CMake mailing list