[CMake] Supported configurations with Visual Studio builds

Brad King brad.king at kitware.com
Tue Oct 16 11:21:52 EDT 2007


Hi Josh,

Thanks for your contributions!

Joshua Jensen wrote:
> My version of CMake with the following changes can be found at:
> 
> svn co svn://svn.luaplus.org/CMake/patches/All CMake
> 
> Most notably is the support in TARGET_LINK_LIBRARIES for multiple configs.

I just downloaded this version.  Most of your fixes look pretty good.

> Windows-cl.cmake:
> 
> * Reservation of a 10 megabyte stack in Windows-cl.cmake is overkill.  
> The default is 1 megabyte.  Why is this here?  I removed it.
> * Visual Studio 2005 doesn't understand /MACHINE:I386.  I changed it to 
> /MACHINE:X86.
> * All /debug linker entries were changed to /DEBUG.  CMake deals with 
> these in a case sensitive fashion.  The Visual C++ linker does not, but 
> all documentation has them all caps.

Please create an entry in the bug tracker and attach a patch for these 
changes.  I'll get them in CMake HEAD.

> FindwxWidgets.cmake:
> 
> * Ability to find the wxAUI library.
> * Can find wxWidgets 2.9 libraries.

...and similarly for these changes, but a separate report.

> Various .cxx files:
> 
> * I commented out the explicit checks for config names of Debug, 
> Release, MinSizeRel, and RelWithDebInfo.  In my projects, I use configs 
> like Debug, Release, Profile, Armor, Release LTCG, and so on.  
> Commenting out the explicit checks allows generation of those configs 
> into the resulting .vcproj file.
> * Added support for .vcproj entries to help unclutter the command line: 
> OptimizeReferences, EnableCOMDATFolding, GenerateDebugInformation, and 
> TargetMachine.
> * Handle the source file property EXCLUDED_FROM_BUILD.  This makes 
> Visual Studio properly exclude the file from a .vcproj.
> * Put CMake targets in a CMake_Targets solution folder in Visual Studio.

...and another entry for these changes.  This way the commit logs will 
be well documented with credit to you through a link to the bug entry.

> * Added support for TARGET_LINK_LIBRARIES(Target config::ConfigName 
> libraries).  This is probably the wrong way to go about doing it, but it 
> works, and I made sure it was backward compatible with the 
> TARGET_LINK_LIBRARIES options 'debug' and 'optimized'.

Per-configuration linking, include directories, and other properties are 
an important feature missing from CMake.  Your fix looks correct, but I 
do not like the introduction of its new syntax.  Even the old "debug" 
and  "release" keyword syntax is not very nice, but was added by a 
third-party back in CMake's earliest days when it was part of another 
project.

We do have plans to add support for per-configuration build properties 
with a more formal design.  Therefore I'm reluctant to accept this part 
of your patch right now.  However I'm interested in applying the other 
parts to CMake HEAD.

Thanks,
-Brad


More information about the CMake mailing list