[CMake] Changing VS2005 Configuration

Jakob Santner santner at icg.tu-graz.ac.at
Fri Oct 12 04:34:13 EDT 2007


Josef Karthauser schrieb:
>> -----Original Message-----
>> From: cmake-bounces+joe.karthauser=geomerics.com at cmake.org
>> [mailto:cmake-bounces+joe.karthauser=geomerics.com at cmake.org] On
> Behalf
>> Of Jakob Santner
>> Sent: 12 October 2007 07:40
>> To: cmake at cmake.org
>> Subject: [CMake] Changing VS2005 Configuration
>>
>> 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?
> 
> For visual studio project files, you can set the configurations to
> include using the CMAKE_CONFIGURATION_TYPES variable.
> 
>     SET(CMAKE_CONFIGURATION_TYPES Release)
> 
> Joe
> 

Thanks for your quick answer. I tried this before and nothing changes.
I'll post my code:

PROJECT(foobar)

SET(CMAKE_CONFIGURATION_TYPES Release)

SET(FOOBAR_SRC foo.cpp bar.cpp)
SET(FOOBAR_HEADER foo.h bar.h)

INCLUDE_DIRECTORIES("C:/Program Files/whatever_inc/")


LINK_DIRECTORIES("C:/Program Files/whatever_lib")

ADD_EXECUTABLE(test ${FOOBAR_SRC} ${FOOBAR_HEADER} test.cpp)

TARGET_LINK_LIBRARIES(test whateverapi)

This cmake file produces a solution named 'foobar' with three projects:
ALL_BUILD
test
ZERO_CHECK
These projects are all configured as Debug.

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