[Cmake-commits] CMake branch, next, updated. v2.8.5-1332-ga355760

David Cole david.cole at kitware.com
Fri Jul 29 10:22:47 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a355760ad2c3f8ba4a0d606dd9e6093ca6aab665 (commit)
       via  37d8602cdee0bdef29f1886fc83f48569addcbd7 (commit)
       via  df9577259ca5a30f5c79baee038fe42e25b4a1e5 (commit)
      from  61df4ad584c7fe193628cd06f709b9008e77840d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a355760ad2c3f8ba4a0d606dd9e6093ca6aab665
commit a355760ad2c3f8ba4a0d606dd9e6093ca6aab665
Merge: 61df4ad 37d8602
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Fri Jul 29 10:22:45 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jul 29 10:22:45 2011 -0400

    Merge topic 'fix-8707-add-vs-globals' into next
    
    37d8602 Merge topic 'intel_fortran_vs2010' into fix-8707-add-vs-globals
    df95772 Add support for Visual Studio project-specific globals (#8707)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37d8602cdee0bdef29f1886fc83f48569addcbd7
commit 37d8602cdee0bdef29f1886fc83f48569addcbd7
Merge: df95772 6c72d25
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Fri Jul 29 10:22:33 2011 -0400
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Fri Jul 29 10:22:33 2011 -0400

    Merge topic 'intel_fortran_vs2010' into fix-8707-add-vs-globals
    
    Conflicts:
    	Source/cmLocalVisualStudio7Generator.h

diff --cc Source/cmLocalVisualStudio7Generator.h
index 4fdbc58,8f7c7eb..35f659f
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@@ -84,8 -86,7 +86,7 @@@ private
    void WriteProjectFiles();
    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 &target);
-   void CreateSingleVCProj(const char *lname, cmTarget &tgt);
    void WriteVCProjFile(std::ostream& fout, const char *libName, 
                         cmTarget &tgt);
    void WriteConfigurations(std::ostream& fout,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df9577259ca5a30f5c79baee038fe42e25b4a1e5
commit df9577259ca5a30f5c79baee038fe42e25b4a1e5
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Fri Jul 29 10:04:36 2011 -0400
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Fri Jul 29 10:04:36 2011 -0400

    Add support for Visual Studio project-specific globals (#8707)
    
    Thanks to Pau Garcia i Quiles for the inspiration for the patch.
    I've tweaked it a bit compared to what's in the bug tracker: this
    commit does not allow empty global variable names.
    
    I also added usage of the new feature to an existing test. Although
    it has no effect on the resulting Visual Studio projects, you can
    verify that the VSResource test produces a non-empty globals section
    in the generated .vcproj(x) files.

diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7a62b9c..3e76f59 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1279,7 +1279,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
   fout << "\t</Files>\n";
 
   // Write the VCProj file's footer.
-  this->WriteVCProjFooter(fout);
+  this->WriteVCProjFooter(fout, target);
 }
 
 struct cmLVS7GFileConfig
@@ -1880,10 +1880,28 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
 }
 
 
-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)
+      {
+      std::string name = i->first.substr(10);
+      if(name != "")
+        {
+        fout << "\t\t<Global\n"
+             << "\t\t\tName=\"" << name << "\"\n"
+             << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n"
+             << "\t\t/>\n";
+        }
+      }
+    }
+
+  fout << "\t</Globals>\n"
        << "</VisualStudioProject>\n";
 }
 
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 160e2d4..4fdbc58 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -84,7 +84,7 @@ private:
   void WriteProjectFiles();
   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 &target);
   void CreateSingleVCProj(const char *lname, cmTarget &tgt);
   void WriteVCProjFile(std::ostream& fout, const char *libName, 
                        cmTarget &tgt);
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index 9e39401..feead00 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -143,6 +143,10 @@ 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 add a Visual Studio "
+        "project-specific global variable. "
+        "Qt integration works better if VS_GLOBAL_QtVersion is set to "
+        "the Qt version FindQt4.cmake found. For example, \"4.7.3\"\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 "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e10ba4a..17a26cc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -960,6 +960,14 @@ void cmTarget::DefineProperties(cmake *cm)
      "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 project-specific 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 VS_GLOBAL_QtVersion is set to the version "
+     "FindQt4.cmake found. For example, \"4.7.3\"");
 
 #if 0
   cm->DefineProperty
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index 5d7d14e..c5cb336 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.3.20110118)
+cmake_minimum_required(VERSION 2.8.4)
 project(VSResource)
 
 string(REPLACE "/INCREMENTAL:YES" ""
@@ -35,3 +35,6 @@ else()
 endif()
 
 add_executable(VSResource main.cpp test.rc)
+
+set_property(TARGET VSResource
+  PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val")

-----------------------------------------------------------------------

Summary of changes:
 Source/cmLocalVisualStudio7Generator.cxx |   26 ++++++++++++++++++++++----
 Source/cmLocalVisualStudio7Generator.h   |    2 +-
 Source/cmSetTargetPropertiesCommand.h    |    4 ++++
 Source/cmTarget.cxx                      |    8 ++++++++
 Tests/VSResource/CMakeLists.txt          |    5 ++++-
 5 files changed, 39 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list