[Cmake-commits] [cmake-commits] david.cole committed cmCallVisualStudioMacro.cxx 1.3 1.4 cmCallVisualStudioMacro.h 1.1 1.2 cmGlobalVisualStudioGenerator.cxx 1.13 1.14 cmake.cxx 1.389 1.390
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jul 30 15:26:36 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv16730
Modified Files:
cmCallVisualStudioMacro.cxx cmCallVisualStudioMacro.h
cmGlobalVisualStudioGenerator.cxx cmake.cxx
Log Message:
BUG: Fix issue #7088 - do not emit error messages when attempts to run Visual Studio macros fail. You can still get the error output as messages if you want using --debug-output from the cmake command line.
Index: cmCallVisualStudioMacro.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCallVisualStudioMacro.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** cmCallVisualStudioMacro.cxx 15 Feb 2008 16:49:58 -0000 1.3
--- cmCallVisualStudioMacro.cxx 30 Jul 2008 19:26:34 -0000 1.4
***************
*** 25,28 ****
--- 25,33 ----
+ // Just for this file:
+ //
+ static bool LogErrorsAsMessages;
+
+
#if defined(HAVE_COMDEF_H)
***************
*** 32,46 ****
//----------------------------------------------------------------------------
! ///! Use ReportHRESULT to make a cmSystemTools::Error after calling
///! a COM method that may have failed.
#define ReportHRESULT(hr, context) \
if (FAILED(hr)) \
{ \
! std::ostringstream oss; \
! oss.flags(std::ios::hex); \
! oss << context << " failed HRESULT, hr = 0x" << hr << std::endl; \
! oss.flags(std::ios::dec); \
! oss << __FILE__ << "(" << __LINE__ << ")"; \
! cmSystemTools::Error(oss.str().c_str()); \
}
--- 37,54 ----
//----------------------------------------------------------------------------
! ///! Use ReportHRESULT to make a cmSystemTools::Message after calling
///! a COM method that may have failed.
#define ReportHRESULT(hr, context) \
if (FAILED(hr)) \
{ \
! if (LogErrorsAsMessages) \
! { \
! std::ostringstream oss; \
! oss.flags(std::ios::hex); \
! oss << context << " failed HRESULT, hr = 0x" << hr << std::endl; \
! oss.flags(std::ios::dec); \
! oss << __FILE__ << "(" << __LINE__ << ")"; \
! cmSystemTools::Message(oss.str().c_str()); \
! } \
}
***************
*** 405,408 ****
--- 413,418 ----
int count = 0;
+ LogErrorsAsMessages = false;
+
#if defined(HAVE_COMDEF_H)
HRESULT hr = CoInitialize(0);
***************
*** 439,446 ****
const std::string& slnFile,
const std::string& macro,
! const std::string& args)
{
int err = 1; // no comdef.h
#if defined(HAVE_COMDEF_H)
err = 2; // error initializing
--- 449,459 ----
const std::string& slnFile,
const std::string& macro,
! const std::string& args,
! const bool logErrorsAsMessages)
{
int err = 1; // no comdef.h
+ LogErrorsAsMessages = logErrorsAsMessages;
+
#if defined(HAVE_COMDEF_H)
err = 2; // error initializing
***************
*** 490,504 ****
(void)macro;
(void)args;
! cmSystemTools::Error("cmCallVisualStudioMacro::CallMacro is not "
! "supported on this platform");
#endif
! if (err)
{
std::ostringstream oss;
oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err;
! cmSystemTools::Error(oss.str().c_str());
}
! return err;
}
--- 503,520 ----
(void)macro;
(void)args;
! if (LogErrorsAsMessages)
! {
! cmSystemTools::Message("cmCallVisualStudioMacro::CallMacro is not "
! "supported on this platform");
! }
#endif
! if (err && LogErrorsAsMessages)
{
std::ostringstream oss;
oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err;
! cmSystemTools::Message(oss.str().c_str());
}
! return 0;
}
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.389
retrieving revision 1.390
diff -C 2 -d -r1.389 -r1.390
*** cmake.cxx 3 Jul 2008 17:55:33 -0000 1.389
--- cmake.cxx 30 Jul 2008 19:26:34 -0000 1.390
***************
*** 1182,1186 ****
<< "\n";
return 0;
! }
// Command to calculate the md5sum of a file
--- 1182,1186 ----
<< "\n";
return 0;
! }
// Command to calculate the md5sum of a file
***************
*** 1423,1427 ****
}
! return cmCallVisualStudioMacro::CallMacro(args[2], args[3], macroArgs);
}
#endif
--- 1423,1428 ----
}
! return cmCallVisualStudioMacro::CallMacro(args[2], args[3],
! macroArgs, true);
}
#endif
Index: cmGlobalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudioGenerator.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -C 2 -d -r1.13 -r1.14
*** cmGlobalVisualStudioGenerator.cxx 1 May 2008 02:17:35 -0000 1.13
--- cmGlobalVisualStudioGenerator.cxx 30 Jul 2008 19:26:34 -0000 1.14
***************
*** 179,184 ****
projects += *it;
}
! cmCallVisualStudioMacro::CallMacro
! (topLevelSlnName, CMAKE_VSMACROS_RELOAD_MACRONAME, projects);
}
}
--- 179,185 ----
projects += *it;
}
! cmCallVisualStudioMacro::CallMacro(topLevelSlnName,
! CMAKE_VSMACROS_RELOAD_MACRONAME, projects,
! this->GetCMakeInstance()->GetDebugOutput());
}
}
***************
*** 186,190 ****
{
cmCallVisualStudioMacro::CallMacro(topLevelSlnName,
! CMAKE_VSMACROS_STOP_MACRONAME, "");
}
}
--- 187,192 ----
{
cmCallVisualStudioMacro::CallMacro(topLevelSlnName,
! CMAKE_VSMACROS_STOP_MACRONAME, "",
! this->GetCMakeInstance()->GetDebugOutput());
}
}
Index: cmCallVisualStudioMacro.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCallVisualStudioMacro.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** cmCallVisualStudioMacro.h 16 Nov 2007 12:01:58 -0000 1.1
--- cmCallVisualStudioMacro.h 30 Jul 2008 19:26:34 -0000 1.2
***************
*** 34,38 ****
static int CallMacro(const std::string& slnFile,
const std::string& macro,
! const std::string& args);
///! Count the number of running instances of Visual Studio with the
--- 34,39 ----
static int CallMacro(const std::string& slnFile,
const std::string& macro,
! const std::string& args,
! const bool logErrorsAsMessages);
///! Count the number of running instances of Visual Studio with the
More information about the Cmake-commits
mailing list