[CMake] Decoupuling configuration and toolchain

Ryan Pavlik rpavlik at iastate.edu
Thu Sep 23 11:23:55 EDT 2010


Keep these lines, if they are necessary for your system:
if(CMAKE_CONFIGURATION_TYPES)
      set(CMAKE_CONFIGURATION_TYPES Debug Release)
      set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE
STRING "Reset the configurations to what we need" FORCE)
endif()

Remove the other lines.  In general, for something like this, you'd have
multiple binary/build directories for a single source tree.  With a
multi-config generator like Visual Studio, you just would need one build
directory for each platform (win32 and arm).  For a single-config generator
like NMake or Unix Makefiles, you'd have one build directory for each
platform-mode pair (win32-release, win32-debug, etc).

Hope this helps!

Ryan

On Thu, Sep 23, 2010 at 9:58 AM, Andrea Galeazzi <galeazzi at korg.it> wrote:

> Hi everybody,
> I've got a project with two configuration (Debug and Release) and two
> target: win32 and ARM.
> In your opinion what's the best way to manage a such kind of project?
> As an example, in my CmakeList I have the following piece of code that
> works fine only for visual studio.
> if(CMAKE_CONFIGURATION_TYPES)
>           set(CMAKE_CONFIGURATION_TYPES Debug Release)
>       set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE
> STRING "Reset the configurations to what we need" FORCE)
>           set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG")
>           set(CMAKE_CXX_FLAGS_RELEASE "/D _NDEBUG")
> endif()
>
> What I need is to move this code in another file so I can also specify
> similar options for gcc etc......
> On the other hand in CMakeList.txt should contain just only the
> sources,include path and the other statements not involving the specific
> target or configuration.
> Cheers
> _______________________________________________
> 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
>



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100923/ed292421/attachment.htm>


More information about the CMake mailing list