[Cmake] How to do configuration specific options in the MS Visual Studio Projects

Aleksey Sanin aleksey at coral8.com
Sat Jun 26 02:32:57 EDT 2004


Hi, All!

Probably the question is trivial but I can find answer in cmake docs or 
in google and
my experiments show no positive signs. Thus I got to a point when I need 
help.

I have a CMake based makefiles system that generates MS VS .NET project 
files.
There is an external library ABC that has two flavors: debug and 
release. Obviously,
I want to link my debug builds with debug version of ABC and link my 
release builds
with release version of ABC. The problem is that both debug and release 
versions
of ABC have *the same* name "libabc.lib". Thus I want to place these 
versions into
two different folders, say "external/debug" and "external/release". Now 
I need to tell
CMake to generate *different* library search paths for "Debug" and 
"Release" configurations
in MS Visual Studio and I can't find a way to do this.

I have found the "debug" and "optimized" flags for LINK_LIBRARIES 
directive. But
this does not work if the library has the same name. By some internal 
reasons, the option
of renaming the library ABC is not a solution. Also I know that I can 
have different debug and
release names for my target and use SET_TARGET_PROPERTIES command to set
different LINK_FLAGS but this is also not acceptable to me. Also 
creating two project
files is not a good idea too.

I would appreciate any hints for the solution.

Thank you in advance,
Aleksey Sanin









More information about the Cmake mailing list