[Cmake] How can I set project options for a VS.NET project us ing CMake

Mathews, Rob rmathews at envoyww . com
Wed, 15 Oct 2003 12:59:24 -0400


Yeah, well was kinda a blocking issue for us, so I grabbed the latest build
and did made the following changes: 

In our CMakeLists.txt file: 

SET(RuntimeLibraryDebug "1" )
SET(RuntimeLibraryRelease "0" )
SET(RuntimeLibraryMinSizeRel "0" )
SET(RuntimeLibraryRelWithDebInfo "0" )

And the CVS diffs follow. You'll probably end out doing something different,
but at least I can keep working.

Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.34
diff -r1.34 cmLocalVisualStudio7Generator.cxx
299a300,303
> 		const char* aRuntimeLibrary =
m_Makefile->GetDefinition("RuntimeLibraryDebug");
> 		if(!aRuntimeLibrary)
> 			aRuntimeLibrary = "3";
> 
301c305
<          << "\t\t\t\tRuntimeLibrary=\"3\"\n"
---
>          << "\t\t\t\tRuntimeLibrary=\"" << aRuntimeLibrary<< "\"\n"
306a311,314
> 		const char* aRuntimeLibrary =
m_Makefile->GetDefinition("RuntimeLibraryRelease");
> 		if(!aRuntimeLibrary)
> 			aRuntimeLibrary = "2";
> 
308c316
<          << "\t\t\t\tRuntimeLibrary=\"2\"\n"
---
> 			<< "\t\t\t\tRuntimeLibrary=\"" << aRuntimeLibrary<<
"\"\n"
313a322,325
> 		const char* aRuntimeLibrary =
m_Makefile->GetDefinition("RuntimeLibraryMinSizeRel");
> 		if(!aRuntimeLibrary)
> 			aRuntimeLibrary = "2";
> 
315c327
<          << "\t\t\t\tRuntimeLibrary=\"2\"\n"
---
> 			<< "\t\t\t\tRuntimeLibrary=\"" << aRuntimeLibrary<<
"\"\n"
320a333,336
> 		const char* aRuntimeLibrary =
m_Makefile->GetDefinition("RuntimeLibraryRelWithDebInfo");
> 		if(!aRuntimeLibrary)
> 			aRuntimeLibrary = "2";
> 
322c338
<          << "\t\t\t\tRuntimeLibrary=\"2\"\n"
---
> 			<< "\t\t\t\tRuntimeLibrary=\"" << aRuntimeLibrary<<
"\"\n"


> -----Original Message-----
> From: William A. Hoffman [mailto:billlist at nycap . rr . com]
> Sent: Wednesday, October 15, 2003 11:47 AM
> To: James, Ron; 'cmake at public . kitware . com'
> Subject: Re: [Cmake] How can I set project options for a 
> VS.NET project
> using CMake
> 
> 
> This is an issue with the VS.NET generator.   The runtime 
> libraries can
> not be changed.   I am going to look into a fix that we might 
> be able to 
> get into the next patch release.
> 
> I don't think that we add a _MBCS, do you know what options 
> control that?
> 
> -Bill
> 
> At 11:06 AM 10/15/2003, James, Ron wrote:
> >I'd like to set VS.NET project properties in a CMake file.
> >
> >For example, a C++ project has the Code Generation list of 
> properties.  I'd
> >like to set the Runtime Library setting to Multi-threaded 
> (/MT).  I can set
> >the /MT switch, but then I get compiler warnings about /MT 
> overriding /MD
> >(the default).  And of course I'd like this set to debug 
> versions when in
> >the Debug environment.
> >
> >I'd also like to set the General properties to "Use Unicode 
> Character Set".
> >Similar issues apply - I can define _UNICODE, but I then end 
> up with both
> >_MBCS and _UNICODE defined.  
> >
> >many thanks
> >
> >
> >Ron James
> >EnvoyWorldWide
> >781 482 2110
> >
> >
> >_______________________________________________
> >Cmake mailing list
> >Cmake at www . cmake . org
> >http://www . cmake . org/mailman/listinfo/cmake 
> 
> 
> _______________________________________________
> Cmake mailing list
> Cmake at www . cmake . org
> http://www . cmake . org/mailman/listinfo/cmake
>