[cmake-developers] [CMake 0012040]: Remove extra line breaks in Eclipse CDT

2011-04-04 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12040 
== 
Reported By:Yuchen Deng
Assigned To:
== 
Project:CMake
Issue ID:   12040
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-04-04 03:46 EDT
Last Modified:  2011-04-04 03:46 EDT
== 
Summary:Remove extra line breaks in Eclipse CDT
Description: 
Hi, CMake Term!
I found a issue, in Eclipse CDT, If a make target use the command like this: 
cmake -E chdir ${ProjDirPath}/Build cmake -DCMAKE_BUILD_TYPE=Release ..
It will output extra line in log window.
Like the picture.

Here is the solution:

FILE: cmSystemTools.cxx
PATCH:
bool cmSystemTools::RunSingleCommand(std::vectorcmStdStringconst command,
 std::string* output ,
 int* retVal , const char* dir , 
 bool verbose ,
 double timeout )
{
...  
  for(int i=0; i  length; ++i)
{
if(data[i] == '\0' || data[i] == '\r')  // PATCH IN HERE
  {
  data[i] = ' ';
  }
}
  }

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-04-04 03:46 Yuchen DengNew Issue
2011-04-04 03:46 Yuchen DengFile Added: 1.png
==

___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Generating information for C++ tools in cmake (patch)

2011-04-04 Thread Brad King
On 04/01/2011 02:42 PM, Manuel Klimek wrote:
 sorry for the delay, but I was busy with other stuff - please find
 attached a proposal patch for the test - I don't know enough about the
 cmake testing infrastructure to say whether that was what you
 imagined, please let me know if I should change anything.

That looks pretty good, thanks.  Here are a few comments from review:

- The cmSystemTools::ParseArguments method is not very solid.  It fails for
  double-quotes in the middle of an argument, like '-Ia b'.  Use the newer
  ParseUnixCommandLine instead.  Unfortunately for historical reasons we
  need to convert from vectorstd::string to vectorcmStdString.  Try
  the patch below.

- The Source directory should not be touched for this.  Put the source code
  in Tests/CMakeLib and move the code to build the executable to the
  CMakeLists.txt file in that directory.

- In the CompileCommandOutput test source files, please actually create a
  symbol in each library and call them from the main.  Otherwise some
  toolchains will complain about empty object files.

- The ADD_TEST_MACRO call will need to be conditioned to run only when the
  exported compile lines will work.  I will take care of that for you when
  the rest of the patch is ready.

Thanks,
-Brad


diff --git a/Source/run_compile_commands.cxx b/Source/run_compile_commands.cxx
index 0b248f7..82cedfb 100644
--- a/Source/run_compile_commands.cxx
+++ b/Source/run_compile_commands.cxx
@@ -117,8 +117,9 @@ int main ()
   it = parser.GetTranslationUnits().begin(),
   end = parser.GetTranslationUnits().end(); it != end; ++it)
 {
-std::vectorcmStdString command =
-cmSystemTools::ParseArguments(it-at(command).c_str());
+std::vectorstd::string command1;
+cmSystemTools::ParseUnixCommandLine(it-at(command).c_str(), command1);
+std::vectorcmStdString command(command1.begin(), command1.end());
 if (!cmSystemTools::RunSingleCommand(
 command, 0, 0, it-at(directory).c_str()))
   {
___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers