[Cmake-commits] CMake branch, next, updated. v2.8.8-3476-ge94500f

Peter Kuemmel syntheticpp at gmx.net
Sun Jul 15 14:01:14 EDT 2012


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  e94500f154f9ec742aacf247840892464a7bffc2 (commit)
       via  6547f369e4c3b71071da8534fcbe141320389c82 (commit)
      from  88dc1b1a096dee2fb417e034de550e89dd59e51c (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=e94500f154f9ec742aacf247840892464a7bffc2
commit e94500f154f9ec742aacf247840892464a7bffc2
Merge: 88dc1b1 6547f36
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sun Jul 15 14:01:01 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jul 15 14:01:01 2012 -0400

    Merge topic 'ninja-mingw-windres' into next
    
    6547f36 Ninja: more searching for windres


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6547f369e4c3b71071da8534fcbe141320389c82
commit 6547f369e4c3b71071da8534fcbe141320389c82
Author:     Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Sun Jul 15 19:38:51 2012 +0200
Commit:     Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Sun Jul 15 19:59:37 2012 +0200

    Ninja: more searching for windres
    
    search for windres with and without prefix,
    and also when only CXX compiler is set.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index ca3a270..abf5c82 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -474,15 +474,30 @@ void cmGlobalNinjaGenerator
       if(mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
         {
         UsingMinGW = true;
-        if(!mf->GetDefinition("CMAKE_RC_COMPILER")
-           && mf->GetDefinition("CMAKE_C_COMPILER"))
+        if(!mf->GetDefinition("CMAKE_RC_COMPILER"))
           {
-          std::string windres = "windres";
-          std::string gcc = mf->GetDefinition("CMAKE_C_COMPILER");
-          std::string::size_type prefix = gcc.rfind("gcc");
-          if (prefix != std::string::npos)
-            windres.insert(0, gcc.substr(0, prefix));
-          windres = cmSystemTools::FindProgram(windres.c_str());
+          std::string windres = cmSystemTools::FindProgram("windres");
+          if(windres.empty())
+            {
+            std::string path;
+            std::string::size_type prefix = std::string::npos;
+            if (mf->GetDefinition("CMAKE_C_COMPILER"))
+              {
+              path = mf->GetDefinition("CMAKE_C_COMPILER");
+              prefix = path.rfind("gcc");
+              }
+            else if (mf->GetDefinition("CMAKE_CXX_COMPILER"))
+              {
+              path = mf->GetDefinition("CMAKE_CXX_COMPILER");
+              prefix = path.rfind("++");
+              prefix--;
+              }
+            if (prefix != std::string::npos)
+              {
+              windres = path.substr(0, prefix) + "windres";
+              windres = cmSystemTools::FindProgram(windres.c_str());
+              }
+            }
           if(!windres.empty())
             mf->AddDefinition("CMAKE_RC_COMPILER", windres.c_str());
           }

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

Summary of changes:
 Source/cmGlobalNinjaGenerator.cxx |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list