[Cmake] MSDev multiple build types

Dekeyser, Kris Kris.Dekeyser at lms.be
Thu Sep 16 09:53:35 EDT 2004


FYI, some feedback. Maybe something worth mentioning in the FAQ list.

I did as you suggested:

- created three template dirs 'Debug', 'Release' and 'DebugRelease'
  (DebugRelease is our internal name for RelWithDebInfo)
- copied the dsp templates to the directories along with
'CMakeVisualStudio6Configurations.cmake' and modified the files
- created a cache value BUILD_TYPE and a macro that changes the
MSPROJECT_TEMPLATE_DIRECTORY and CMAKE_BUILD_TYPE accordingly

That works like a charm. I attached a zip file with the modified templates.

Now in my CMakeLists.txt files I can detect debug configuration and set
special defines and add extra include directories and files depending on the
build type.

If anybody would like to try and do the same, beware however in how you
change the dsp templates. I don't know the specs of the DSPs and what VS6
accepts as minimal contents, but I have gathered my experiences by
trial-and-error. I was able to remove the '!IF  "$(CFG)" ==' lines and
everything in between that is not relevant to the selected build type, but I
had to be careful about removing the other stuff. You SHOULD remove all
unused targets (e.g. # Name "OUTPUT_LIBNAME - Win32 Release"), change the
CFG= line to the selected build type, but be careful about the !MESSAGE
lines beneath. On several occasions I had either VS6 refusing to load the
project or even crashing right after loading the DSPs. I changed the list of
"Possible choices for configuration" to include only the one that is
relevant, but removing the list altogether made the DSP invalid.

Generally speaking you should change the !MESSAGE lines as little as
possible and changing any lines from the last '!MESSAGE' line to the first
'!IF  "$(CFG)" ==' should be avoided completely.

- Kris

> -----Original Message-----
> From: Dekeyser, Kris [mailto:Kris.Dekeyser at lms.be]
> Sent: Wednesday, August 25, 2004 18:21
> To: 'William A. Hoffman'; CMake (E-mail)
> Subject: RE: [Cmake] MSDev multiple build types
> 
> 
> Whow! Do you mean for VS6, I can simply create a separate dir 
> for each build
> type containing single build type templates and set
> MSPROJECT_TEMPLATES_DIRECTORY in my CMakeLists.txt depending 
> on the user's
> selection? 
> 
> Is it that easy? Amazing! 
> 
> There goes my hacking code down the drain. Luckily. ;-)
> 
> - Kris
> 
> > -----Original Message-----
> > From: William A. Hoffman [mailto:billlist at nycap.rr.com]
> > Sent: Wednesday, August 25, 2004 17:56
> > To: Dekeyser, Kris; CMake (E-mail)
> > Subject: RE: [Cmake] MSDev multiple build types
> > 
> > 
> > With VS7 it is possible to restrict the configuration to only 
> > one type by
> > setting the CMAKE_CONFIGURATION_TYPES to contain only one of 
> > them, say Debug.
> > You can provide your own template files for VS6.   If you set this:
> > MSPROJECT_TEMPLATE_DIRECTORY.   Then just copy the templates 
> > from cmake to ones
> > that do not use the config dir.
> > 
> > So, you could make it so that only one directory is used, and 
> > you have to 
> > switch the build type from cmake just like with the makefiles.   
> > 
> > -Bill
> +-+-+- Email Confidentiality Footer +-+-+- 
> Privileged/Confidential Information may be contained in this 
> message. If you
> are not the addressee indicated in this message (or 
> responsible for delivery
> of the message to such person), you may not print, retain, copy nor
> disseminate this message or any part of it to anyone and you 
> should notify
> the sender by reply email and destroy this message. 
> Neglecting this clause
> could be a breach of confidence. Please advise immediately if 
> you or your
> employer does not consent to Internet email for messages of this kind.
> Opinions, conclusions and other information in this message 
> that are not
> related to the official business of my firm shall be 
> understood as neither
> given nor endorsed by it.
> _______________________________________________
> Cmake mailing list
> Cmake at www.cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
+-+-+- Email Confidentiality Footer +-+-+- 
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not print, retain, copy nor
disseminate this message or any part of it to anyone and you should notify
the sender by reply email and destroy this message. Neglecting this clause
could be a breach of confidence. Please advise immediately if you or your
employer does not consent to Internet email for messages of this kind.
Opinions, conclusions and other information in this message that are not
related to the official business of my firm shall be understood as neither
given nor endorsed by it.
  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: VS6templates.zip
Type: application/octet-stream
Size: 20435 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20040916/efa63fee/VS6templates-0001.obj


More information about the Cmake mailing list