[CMake] Different configurations for Debug and Release

Tyler Roscoe tyler at cryptio.net
Mon Jun 7 16:25:04 EDT 2010


On Mon, Jun 07, 2010 at 03:04:02PM -0300, Felipe Sodré Silva wrote:
> The CXX_FLAGS part seems to work (I needed the LINK_FLAGS_RELEASE), but I
> also need to include a library (through target_link_libraries) if and only
> if I am building a release version. Is that possible?

Look at the debug and optimized flags for target_link_libraries().

tyler

> On Mon, Jun 7, 2010 at 2:50 PM, Tyler Roscoe <tyler at cryptio.net> wrote:
> 
> > On Mon, Jun 07, 2010 at 02:43:35PM -0300, Felipe Sodré Silva wrote:
> > > I need to write a CMakeLists file to generate a VS 2005 project in which
> > I
> > > can have different project settings for Debug and Release configurations.
> > >
> > > For example, I need to have a set_target_properties directive for Release
> > > builds, but not for Debug builds. Is it possible to write such a
> > CMakeLists
> > > that does this?
> >
> > Depends on what property/variable you're trying to set. Many of the
> > interesting ones (e.g. CXX_FLAGS) have configuration-specific variants
> > (e.g. CXX_FLAGS_RELEASE, CXX_FLAGS_RELEASE).
> >
> > tyler
> >


More information about the CMake mailing list