[CMake] Different configurations for Debug and Release

Torri, Stephen CIV NSWCDD, W15 stephen.torri at navy.mil
Tue Jun 8 08:45:40 EDT 2010


> From: cmake-bounces at cmake.org on behalf of Tyler Roscoe
> Sent: Mon 6/7/2010 4:25 PM
> To: Felipe Sodré Silva
> Cc: cmake at cmake.org
> Subject: Re: [CMake] Different configurations for Debug and Release
> 
> > 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().

In my project the external libraries I use have the debug library files are in a different directory from the release versions. I don't think I can use target_link_libraries to include a path as well as the name. In documentation I would use link_directories but there is no way in the syntax to distinguish a debug directory from a release directory. I am trying to generate a Visual Studio project that can build a debug release if I select "Debug" in the configuration manager drop down menu or "Release". Is there a way for me to tell CMake that a certain set of directories the linker should use to search for files for the debug build versus another?
 
Stephen 




More information about the CMake mailing list