[CMake] Multiple platforms/configurations

Tom Deblauwe Tom.Deblauwe at traficon.com
Tue Nov 8 15:08:03 EST 2011


Hello,

I have 2 build configurations for the same source code and I am generating visual studio 2005 projects. So for the first configuration I need different defines than for the second configuration. So I do like this:

mkdir build1
cd build1
cmake -DPORT=bla ../source
mkdir build2
cd build2
cmake -DPORT=foo ../source

This generates 2 visual studio 2005 solutions, one in build1 and one in build2. Now there are two project files and two solutions and each has one configuration. However I am porting existing code and the old habit was that the two build configurations were in the same .vcproj and .sln file so you could easily switch between the two configurations in visual studio. Are there any cmake ways to make this happen, so to have one project with all the configs?

Best regards,
Tom,


More information about the CMake mailing list