| Attached Files | vs_global.diff [^] (4,407 bytes) 2009-03-09 18:54 [Show Content] [Hide Content]Index: Source/cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.236
diff -u -p -d -r1.236 cmLocalVisualStudio7Generator.cxx
--- Source/cmLocalVisualStudio7Generator.cxx 27 Jan 2009 15:26:55 -0000 1.236
+++ Source/cmLocalVisualStudio7Generator.cxx 9 Mar 2009 21:49:05 -0000
@@ -1206,7 +1206,7 @@ void cmLocalVisualStudio7Generator::Writ
fout << "\t</Files>\n";
// Write the VCProj file's footer.
- this->WriteVCProjFooter(fout);
+ this->WriteVCProjFooter(fout, target);
}
struct cmLVS7GFileConfig
@@ -1856,10 +1856,24 @@ cmLocalVisualStudio7Generator::WriteProj
}
-void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout)
+void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout, cmTarget &target)
{
- fout << "\t<Globals>\n"
- << "\t</Globals>\n"
+ fout << "\t<Globals>\n";
+
+ cmPropertyMap const& props = target.GetProperties();
+ for(cmPropertyMap::const_iterator i = props.begin();
+ i != props.end(); ++i)
+ {
+ if(i->first.find("VS_GLOBAL_") == 0)
+ {
+ fout << "\t\t<Global\n"
+ << "\t\t\tName=\"" << i->first.substr(10).c_str() << "\"\n"
+ << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n"
+ << "\t\t/>\n";
+ }
+ }
+
+ fout << "\t</Globals>\n"
<< "</VisualStudioProject>\n";
}
Index: Source/cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.51
diff -u -p -d -r1.51 cmLocalVisualStudio7Generator.h
--- Source/cmLocalVisualStudio7Generator.h 30 Apr 2008 17:26:03 -0000 1.51
+++ Source/cmLocalVisualStudio7Generator.h 9 Mar 2009 21:49:19 -0000
@@ -80,7 +80,7 @@ private:
void WriteStampFiles();
void WriteVCProjHeader(std::ostream& fout, const char *libName,
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
- void WriteVCProjFooter(std::ostream& fout);
+ void WriteVCProjFooter(std::ostream& fout, cmTarget &tgt);
void CreateSingleVCProj(const char *lname, cmTarget &tgt);
void WriteVCProjFile(std::ostream& fout, const char *libName,
cmTarget &tgt);
Index: Source/cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.32
diff -u -p -d -r1.32 cmSetTargetPropertiesCommand.h
--- Source/cmSetTargetPropertiesCommand.h 7 Oct 2008 20:23:20 -0000 1.32
+++ Source/cmSetTargetPropertiesCommand.h 9 Mar 2009 22:44:49 -0000
@@ -148,6 +148,9 @@ public:
"VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set "
"to add support for source control bindings in a Visual Studio "
"project file.\n"
+ "VS_GLOBAL_<variable> can be set to set a global (internal to the "
+ "project) variable to a given value. QT integration works "
+ "better if this is set to the Qt version FindQt4.cmake found.\n"
"When a library is built CMake by default generates code to remove "
"any existing library using all possible names. This is needed "
"to support libraries that switch between STATIC and SHARED by "
Index: Source/cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.235
diff -u -p -d -r1.235 cmTarget.cxx
--- Source/cmTarget.cxx 10 Feb 2009 13:51:13 -0000 1.235
+++ Source/cmTarget.cxx 9 Mar 2009 22:39:11 -0000
@@ -732,6 +732,13 @@ void cmTarget::DefineProperties(cmake *c
"Visual Studio Source Code Control Project.",
"Can be set to change the visual studio source code control "
"project name property.");
+ cm->DefineProperty
+ ("VS_GLOBAL_<variable>", cmProperty::TARGET,
+ "Visual Studio global variable.",
+ "Tell the Visual Studio generator to set the global variable "
+ "<variable>' to a given value in the generated visual studio "
+ "project. Ignored on other generators. QT integration works "
+ "better if this is set to the version FindQt4.cmake found. ");
#if 0
cm->DefineProperty
vs_global_2.8.1rc1.diff [^] (4,393 bytes) 2010-02-08 16:49 [Show Content] [Hide Content]Index: Source/cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.236
diff -u -p -d -r1.236 cmLocalVisualStudio7Generator.cxx
--- Source/cmLocalVisualStudio7Generator.cxx 27 Jan 2009 15:26:55 -0000 1.236
+++ Source/cmLocalVisualStudio7Generator.cxx 9 Mar 2009 21:49:05 -0000
@@ -1206,7 +1206,7 @@ void cmLocalVisualStudio7Generator::Writ
fout << "\t</Files>\n";
// Write the VCProj file's footer.
- this->WriteVCProjFooter(fout);
+ this->WriteVCProjFooter(fout, target);
}
struct cmLVS7GFileConfig
@@ -1856,10 +1856,24 @@ cmLocalVisualStudio7Generator::WriteProj
}
-void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout)
+void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout, cmTarget &target)
{
- fout << "\t<Globals>\n"
- << "\t</Globals>\n"
+ fout << "\t<Globals>\n";
+
+ cmPropertyMap const& props = target.GetProperties();
+ for(cmPropertyMap::const_iterator i = props.begin();
+ i != props.end(); ++i)
+ {
+ if(i->first.find("VS_GLOBAL_") == 0)
+ {
+ fout << "\t\t<Global\n"
+ << "\t\t\tName=\"" << i->first.substr(10).c_str() << "\"\n"
+ << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n"
+ << "\t\t/>\n";
+ }
+ }
+
+ fout << "\t</Globals>\n"
<< "</VisualStudioProject>\n";
}
Index: Source/cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.51
diff -u -p -d -r1.51 cmLocalVisualStudio7Generator.h
--- Source/cmLocalVisualStudio7Generator.h 30 Apr 2008 17:26:03 -0000 1.51
+++ Source/cmLocalVisualStudio7Generator.h 9 Mar 2009 21:49:19 -0000
@@ -80,7 +80,7 @@ private:
void WriteStampFiles();
void WriteVCProjHeader(std::ostream& fout, const char *libName,
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
- void WriteVCProjFooter(std::ostream& fout);
+ void WriteVCProjFooter(std::ostream& fout, cmTarget &tgt);
void CreateSingleVCProj(const char *lname, cmTarget &tgt);
void WriteVCProjFile(std::ostream& fout, const char *libName,
cmTarget &tgt);
Index: Source/cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.32
diff -u -p -d -r1.32 cmSetTargetPropertiesCommand.h
--- Source/cmSetTargetPropertiesCommand.h 7 Oct 2008 20:23:20 -0000 1.32
+++ Source/cmSetTargetPropertiesCommand.h 9 Mar 2009 22:44:49 -0000
@@ -148,6 +148,9 @@ public:
"VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set "
"to add support for source control bindings in a Visual Studio "
"project file.\n"
+ "VS_GLOBAL_<variable> can be set to set a global (internal to the "
+ "project) variable to a given value. QT integration works "
+ "better if this is set to the Qt version FindQt4.cmake found.\n"
"The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
"old way to specify CMake scripts to run before and after "
"installing a target. They are used only when the old "
Index: Source/cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.235
diff -u -p -d -r1.235 cmTarget.cxx
--- Source/cmTarget.cxx 10 Feb 2009 13:51:13 -0000 1.235
+++ Source/cmTarget.cxx 9 Mar 2009 22:39:11 -0000
@@ -732,6 +732,13 @@ void cmTarget::DefineProperties(cmake *c
"Visual Studio Source Code Control Project.",
"Can be set to change the visual studio source code control "
"project name property.");
+ cm->DefineProperty
+ ("VS_GLOBAL_<variable>", cmProperty::TARGET,
+ "Visual Studio global variable.",
+ "Tell the Visual Studio generator to set the global variable "
+ "<variable>' to a given value in the generated visual studio "
+ "project. Ignored on other generators. QT integration works "
+ "better if this is set to the version FindQt4.cmake found. ");
#if 0
cm->DefineProperty
|