[CMake] Multiple platforms/configurations

Tom Deblauwe Tom.Deblauwe at traficon.com
Wed Nov 9 06:19:43 EST 2011


What exactly do you do with that PORT variable in your CMakeLists.txt
file? Perhaps, you might simply map different values to configuration-
specific properties like COMPILE_DEFINITIONS_<CONFIG>. If you do more
complicated things based on the PORT variable's value, please provide
more information, at best a small but complete example, so we can see
whether there is a possibility to set up any comprehensive solution.

Hello,

The PORT variable is something I got from this wiki: http://trac.webkit.org/wiki/WinCE

I am using the same system to build my source code for WinCe and for Win32. So here I have made a zip file of a simple example project that uses cmake and has the same structure as my source: http://users.telenet.be/thevikings/cmake/cmake-example-project.zip

So the zip also contains the two separate builds I generated with cmake, so the first one "build-example-mx31" I made with this command:

cmake -G "Visual Studio 8 2005" -DCMAKE_WINCE_SDK="MX31Module (ARMV4I)" -DPORT=Mx31 ../repo/apps/Example

This gives me the visual studio solution as you can see in the zip file in the file "pics/mx31-one-configuration.png".

And the second directory "build-example-mx31" was like this:

cmake -G "Visual Studio 8 2005" -DPORT=Win32 ../repo/apps/Example

This gives me the visual studio solution as you can see in the zip file in the file "pics/win32-one-configuration.png".

The problem I want to solve now is that I used to get one solution which has two configurations as you can see in the pictures included in the zip called "pics/old-style.png". So in the configurations dropdown of visual studio I had the choice between "MX31Module (ARMV4I)" and "Win32". Now my question is how can I have this with cmake? Or is my approach not good?

Best regards,
Tom,



More information about the CMake mailing list