[Cmake-commits] CMake branch, next, updated. v2.8.3-1461-g196a6f2

David Cole david.cole at kitware.com
Fri Jan 21 11:52:55 EST 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  196a6f232f89257dfb86a4d2c8fb547ebfbb0592 (commit)
       via  0cde56dda4b93a8a51196dbd8c26fdf530a70968 (commit)
      from  68e6e56d5ad06289d058602c10c91045a743b449 (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=196a6f232f89257dfb86a4d2c8fb547ebfbb0592
commit 196a6f232f89257dfb86a4d2c8fb547ebfbb0592
Merge: 68e6e56 0cde56d
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Fri Jan 21 11:52:53 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 21 11:52:53 2011 -0500

    Merge topic 'fix-11147-avoid-vc10-filters-error-msg' into next
    
    0cde56d VS10: Load projects with obj "source" files (#11147)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cde56dda4b93a8a51196dbd8c26fdf530a70968
commit 0cde56dda4b93a8a51196dbd8c26fdf530a70968
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Fri Jan 21 10:57:34 2011 -0500
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Fri Jan 21 10:57:34 2011 -0500

    VS10: Load projects with obj "source" files (#11147)
    
    WriteCLSources should skip source files with "obj" extensions
    since WriteObjSources has already written them into the vcxproj
    file. Likewise, WriteGroupSources should skip source files with
    "obj" extensions to avoid receiving "item ... already exists under
    the filter" project-load-time error messages from Visual Studio.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ab282b0..2d55e1e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -597,7 +597,11 @@ WriteGroupSources(const char* name,
   for(std::vector<cmSourceFile*>::const_iterator s = sources.begin();
       s != sources.end(); ++s)
     {
-    cmSourceFile* sf = *s; 
+    cmSourceFile* sf = *s;
+    if(sf->GetExtension() == "obj")
+      {
+      continue;
+      }
     std::string const& source = sf->GetFullPath();
     cmSourceGroup& sourceGroup = 
       this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
@@ -666,55 +670,56 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
   for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
       source != sources.end(); ++source)
     {
-    // if it is not a custom command then add it as a c/c++ file,
-    // TODO: need to check for idl or rc
-    if(!(*source)->GetCustomCommand())
+    std::string ext = (*source)->GetExtension();
+    if((*source)->GetCustomCommand() || ext == "obj")
       {
-      bool header = (*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
-        || this->GlobalGenerator->IgnoreFile
-        ((*source)->GetExtension().c_str());
-      const char* lang = (*source)->GetLanguage();
-      bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0);
-      bool rc = lang && (strcmp(lang, "RC") == 0);
-      bool idl = (*source)->GetExtension() == "idl";
-      std::string sourceFile = (*source)->GetFullPath();
-      sourceFile =  cmSystemTools::RelativePath(
-        this->Makefile->GetCurrentOutputDirectory(),
-        sourceFile.c_str());
-      this->ConvertToWindowsSlash(sourceFile);
-      // output the source file
-      if(header)
-        {
-        this->WriteString("<ClInclude Include=\"", 2);
-        }
-      else if(cl)
-        {
-        this->WriteString("<ClCompile Include=\"", 2);
-        }
-      else if(rc)
-        {
-        this->WriteString("<ResourceCompile Include=\"", 2);
-        }
-      else if(idl)
-        {
-        this->WriteString("<Midl Include=\"", 2);
-        }
-      else
-        {
-        this->WriteString("<None Include=\"", 2);
-        }
-      (*this->BuildFileStream ) << sourceFile << "\"";
-      // ouput any flags specific to this source file
-      if(!header && cl && this->OutputSourceSpecificFlags(*source))
-        {
-        // if the source file has specific flags the tag
-        // is ended on a new line
-        this->WriteString("</ClCompile>\n", 2);
-        }
-      else
-        {
-        (*this->BuildFileStream ) << " />\n";
-        }
+      continue;
+      }
+    // If it is not a custom command and it is not a pre-built obj file,
+    // then add it as a source (c/c++/header/rc/idl) file
+    bool header = (*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
+      || this->GlobalGenerator->IgnoreFile(ext.c_str());
+    const char* lang = (*source)->GetLanguage();
+    bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0);
+    bool rc = lang && (strcmp(lang, "RC") == 0);
+    bool idl = ext == "idl";
+    std::string sourceFile = (*source)->GetFullPath();
+    sourceFile =  cmSystemTools::RelativePath(
+      this->Makefile->GetCurrentOutputDirectory(),
+      sourceFile.c_str());
+    this->ConvertToWindowsSlash(sourceFile);
+    // output the source file
+    if(header)
+      {
+      this->WriteString("<ClInclude Include=\"", 2);
+      }
+    else if(cl)
+      {
+      this->WriteString("<ClCompile Include=\"", 2);
+      }
+    else if(rc)
+      {
+      this->WriteString("<ResourceCompile Include=\"", 2);
+      }
+    else if(idl)
+      {
+      this->WriteString("<Midl Include=\"", 2);
+      }
+    else
+      {
+      this->WriteString("<None Include=\"", 2);
+      }
+    (*this->BuildFileStream ) << sourceFile << "\"";
+    // ouput any flags specific to this source file
+    if(!header && cl && this->OutputSourceSpecificFlags(*source))
+      {
+      // if the source file has specific flags the tag
+      // is ended on a new line
+      this->WriteString("</ClCompile>\n", 2);
+      }
+    else
+      {
+      (*this->BuildFileStream ) << " />\n";
       }
     }
   this->WriteString("</ItemGroup>\n", 1);

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

Summary of changes:
 Source/cmVisualStudio10TargetGenerator.cxx |  105 +++++++++++++++-------------
 1 files changed, 55 insertions(+), 50 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list