[CMake] Different configurations with Visual Studio

Mark Van Peteghem markvp at gmail.com
Mon Jul 5 07:31:41 EDT 2010


I see, thanks. I intend to write a Python script that adds the extra
platform solution, because we really need that. Visual Studio and
Code::Blocks project files are XML files, so it shouldn't be too hard.

2010/7/2 <aaron.meadows at thomsonreuters.com>

>  *I don’t believe this is possible.  There was actually a discussion about
> this, simultaneous to your question, regarding x86 and x64 builds in the
> same solution files.  The answer given was that it is not possible, and it
> is better to have an x86 build tree and an x64 build tree.  There was a link
> given to a deeper discussion: **
> http://www.cmake.org/pipermail/cmake/2009-June/029897.html*
>
> * *
>
> *The thread yesterday has the subject: Generating a combined x86 and x64
> Visual Studio project*
>
> * *
>
> *HTH!*
>
> * *
>
> *Aaron C. Meadows*
>   ------------------------------
>
> *From:* cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] *On
> Behalf Of *Mark Van Peteghem
> *Sent:* Thursday, July 01, 2010 2:13 AM
> *To:* cmake at cmake.org
> *Subject:* Re: [CMake] Different configurations with Visual Studio
>
>
>
> Thanks, this works. Actually
>
> if(CMAKE_CONFIGURATION_TYPES)
>    set(CMAKE_CONFIGURATION_TYPES Debug Release DebugMX31 ReleaseMX31)
>
>    set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE
> STRING
>
>      "Reset the configurations to what we need" FORCE)
>  endif()
>
> also works for me. I've added it to the FAQ of the Wiki. But this is only
> half of what need. I actually need to make this generate settings for a
> different platform as well, I mean 'platform' in the Visual Studio sense,
> also called 'solution platform' in Visual Studios configuration manager,
> which is Win32 by default, but I need it for both Win32 and MX31.
>
> Can this be done with CMake? I'm afraid not, but if it is possible, how? In
> the project file it is written as something like Debug|MX31, but using that
> in CMake doesn't work.
>
> Mark
>
> 2010/6/28 Michael Wild <themiwi at gmail.com>
>
>
> On 28. Jun, 2010, at 15:17 , Mark Van Peteghem wrote:
>
> > Hi,
> >
> > I am using CMake to generate Visual Studio project files, later also for
> > CodeBlocks.
> >
> > It seems that CMake generates four different configurations for Visual
> > Studio: Debug, Release, MinSizeRel and RelWithDebInfo. However, I need
> other
> > configuations, Debug and Release, both for Win32 and MX3, in one project
> > file. How do I change this?
> >
> > I tried this by changing *CMAKE_CONFIGURATION_TYPES *and
> CMAKE_BUILD_TYPES,
> > e.g.
> >
> > SET(CMAKE_BUILD_TYPES Debug Release DebugMX31 ReleaseMX31)
> >
> > but I have the impression that these variables cannot be changed.
> >
> > --
> > Mark
>
> You have to change CMAKE_CONFIGURATION_TYPES in the cache. Here is some
> template I use:
>
> # Xcode generator is buggy (linker flags are not inherited from compile
> flags
> # and custom configurations don't work with shared libraries)
> if(NOT CMAKE_GENERATOR STREQUAL Xcode)
>  set(CMAKE_C_FLAGS_SUPERDUPER "--super --duper" CACHE
>    STRING "Flags used by the compiler during super-duper builds")
>  set(CMAKE_EXE_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
>    STRING "Flags used by the linker for executables during super-duper
> builds")
>  set(CMAKE_SHARED_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
>    STRING "Flags used by the linker for shared libraries during super-duper
> builds")
>  set(CMAKE_MODULE_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
>    STRING "Flags used by the linker for loadable modules during super-duper
> builds")
>  mark_as_advanced(CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_SUPERDUPER
>    CMAKE_SHARED_LINKER_FLAGS_SUPERDUPER
> CMAKE_MODULE_LINKER_FLAGS_SUPERDUPER)
>  # This variable is only set for multi-config IDE generators
>  if(CMAKE_CONFIGURATION_TYPES)
>    list(APPEND CMAKE_CONFIGURATION_TYPES SuperDuper)
>    list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
>    set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE
> STRING
>      "Semicolon separated list of supported configuration types
> [Debug|Release|MinSizeRel|RelWithDebInfo|SuperDuper]"
>      FORCE)
>  endif()
> endif()
>
> HTH
>
> Michael
>
>
>
> This email was sent to you by Thomson Reuters, the global news and
> information company.
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of Thomson
> Reuters.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100705/5b3959f3/attachment-0001.htm>


More information about the CMake mailing list