[CMake] CMake for Visual and BUILD_TYPE

Tyler Roscoe tyler at cryptio.net
Thu Sep 17 02:39:19 EDT 2009


On Thu, Sep 17, 2009 at 07:55:29AM +0200, Xavier Larrodé wrote:
> On linux i always use the command CMAKE_BUILD_TYPE to set the binary dir.
> But on windows, even if a project is set with cmake as Build Debug, it
> generates the Release cmake project too.

In Visual Studio and other IDEs, the user picks which configuration to
build from a drop-down, so you can't know which thing you're going to
build at CMake ime. It's a huge pain in the butt for build development
(though quite useful for IDE users).

Some things that help a lot are:

- CMAKE_CFG_INTDIR, which basically resolves to $(OutDir) in VS. Check
  the docs for more details.

- Most of the key properties (COMPILE_DEFINITION, LINK_FLAGS) have
  _DEBUG and _RELEASE variants that are applied only to those build
  configs.

Poke around in the archives with some of those keywords to see more
examples.

tyler


More information about the CMake mailing list