[Cmake-commits] CMake branch, next, updated. v2.8.11.2-2991-g8b6592d

Brad King brad.king at kitware.com
Tue Jul 9 15:06:13 EDT 2013


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  8b6592de5e49dd4ea66e0cc4e121b30da3442923 (commit)
       via  18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4 (commit)
      from  6decd3d707551934dc2850dbc403000f8608fdf4 (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=8b6592de5e49dd4ea66e0cc4e121b30da3442923
commit 8b6592de5e49dd4ea66e0cc4e121b30da3442923
Merge: 6decd3d 18e1bfb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 9 15:06:10 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 9 15:06:10 2013 -0400

    Merge topic 'cmake-error-advice' into next
    
    18e1bfb cmake: On configure error suggest looking at CMake*.log files


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4
commit 18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 9 14:35:49 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 9 15:00:39 2013 -0400

    cmake: On configure error suggest looking at CMake*.log files
    
    When CMake reports failure to configure a project, especially when the
    toolchain does not initialize properly, the true reason may be clear
    from reading the CMakeFiles/CMake(Output|Error).log files.  Advise users
    to look at these files if they exist when configuration fails.
    
    Add RunCMake.Configure test to check that the log files are mentioned
    when configuration fails.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ad74767..19b9110 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -892,12 +892,28 @@ void cmGlobalGenerator::Configure()
 
   if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE)
     {
-    const char* msg = "Configuring done";
+    cmOStringStream msg;
     if(cmSystemTools::GetErrorOccuredFlag())
       {
-      msg = "Configuring incomplete, errors occurred!";
+      msg << "Configuring incomplete, errors occurred!";
+      const char* logs[] = {"CMakeOutput.log", "CMakeError.log", 0};
+      for(const char** log = logs; *log; ++log)
+        {
+        std::string f = this->CMakeInstance->GetHomeOutputDirectory();
+        f += this->CMakeInstance->GetCMakeFilesDirectory();
+        f += "/";
+        f += *log;
+        if(cmSystemTools::FileExists(f.c_str()))
+          {
+          msg << "\nSee also \"" << f << "\".";
+          }
+        }
+      }
+    else
+      {
+      msg << "Configuring done";
       }
-    this->CMakeInstance->UpdateProgress(msg, -1);
+    this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1);
     }
 }
 
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c1a08d2..e049854 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -56,6 +56,7 @@ add_RunCMake_test(CTest)
 if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
   add_RunCMake_test(CompilerChange)
 endif()
+add_RunCMake_test(Configure)
 add_RunCMake_test(ExternalData)
 add_RunCMake_test(FPHSA)
 add_RunCMake_test(GeneratorExpression)
diff --git a/Tests/RunCMake/Configure/CMakeLists.txt b/Tests/RunCMake/Configure/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/Configure/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Configure/ErrorLogs-result.txt b/Tests/RunCMake/Configure/ErrorLogs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Configure/ErrorLogs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt
new file mode 100644
index 0000000..4eee45d
--- /dev/null
+++ b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at ErrorLogs.cmake:3 \(message\):
+  Some error!
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Configure/ErrorLogs-stdout.txt b/Tests/RunCMake/Configure/ErrorLogs-stdout.txt
new file mode 100644
index 0000000..c467b62
--- /dev/null
+++ b/Tests/RunCMake/Configure/ErrorLogs-stdout.txt
@@ -0,0 +1,3 @@
+-- Configuring incomplete, errors occurred!
+See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeOutput\.log"\.
+See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeError\.log"\.
diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake
new file mode 100644
index 0000000..e8cf062
--- /dev/null
+++ b/Tests/RunCMake/Configure/ErrorLogs.cmake
@@ -0,0 +1,3 @@
+file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+  "Some detailed error information!\n")
+message(SEND_ERROR "Some error!")
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
new file mode 100644
index 0000000..46f9184
--- /dev/null
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(ErrorLogs)

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

Summary of changes:
 Source/cmGlobalGenerator.cxx                       |   22 +++++++++++++++++--
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../RunCMake/{CMP0004 => Configure}/CMakeLists.txt |    0
 .../ErrorLogs-result.txt}                          |    0
 Tests/RunCMake/Configure/ErrorLogs-stderr.txt      |    4 +++
 Tests/RunCMake/Configure/ErrorLogs-stdout.txt      |    3 ++
 Tests/RunCMake/Configure/ErrorLogs.cmake           |    3 ++
 Tests/RunCMake/Configure/RunCMakeTest.cmake        |    3 ++
 8 files changed, 33 insertions(+), 3 deletions(-)
 copy Tests/RunCMake/{CMP0004 => Configure}/CMakeLists.txt (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Configure/ErrorLogs-result.txt} (100%)
 create mode 100644 Tests/RunCMake/Configure/ErrorLogs-stderr.txt
 create mode 100644 Tests/RunCMake/Configure/ErrorLogs-stdout.txt
 create mode 100644 Tests/RunCMake/Configure/ErrorLogs.cmake
 create mode 100644 Tests/RunCMake/Configure/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list