MantisBT - CMake
View Issue Details
0012040CMakeCMakepublic2011-04-04 03:462011-05-07 03:21
Yuchen Deng 
Alex Neundorf 
normalminoralways
closedwon't fix 
Win32Windows 7SP1
CMake 2.8.4 
 
0012040: Remove extra line breaks in Eclipse CDT
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::vector<cmStdString>const& 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] = ' ';
          }
        }
      }
No tags attached.
png 1.png (50,555) 2011-04-04 03:46
https://public.kitware.com/Bug/file/3797/1.png
png

png 2.png (22,323) 2011-04-04 19:52
https://public.kitware.com/Bug/file/3799/2.png
png
Issue History
2011-04-04 03:46Yuchen DengNew Issue
2011-04-04 03:46Yuchen DengFile Added: 1.png
2011-04-04 11:40Brad KingAssigned To => Alex Neundorf
2011-04-04 11:40Brad KingStatusnew => assigned
2011-04-04 16:12Alex NeundorfNote Added: 0026086
2011-04-04 19:51Yuchen DengNote Added: 0026089
2011-04-04 19:52Yuchen DengFile Added: 2.png
2011-04-04 19:59Yuchen DengNote Added: 0026091
2011-04-04 19:59Yuchen DengNote Edited: 0026091bug_revision_view_page.php?bugnote_id=26091#r288
2011-05-06 17:08Alex NeundorfNote Added: 0026452
2011-05-06 23:06Yuchen DengNote Added: 0026456
2011-05-07 03:21Alex NeundorfNote Added: 0026457
2011-05-07 03:21Alex NeundorfStatusassigned => closed
2011-05-07 03:21Alex NeundorfResolutionopen => won't fix

Notes
(0026086)
Alex Neundorf   
2011-04-04 16:12   
Are you using the Eclipse project generator in cmake ?
How does such a custom target look in your CMakeLists.txt, i.e. can you please post some code snippet from your CMakeLists.txt here ?

I.e. I don't understand why you need to call cmake in a custom command.

Alex
(0026089)
Yuchen Deng   
2011-04-04 19:51   
OK, I am using CDT 8.0, Here is a demo CMakeLists.txt content:
----
project(MBR)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
----
Then, I am using 'Make Target' to control everything.

e.g.
----
Build = cmake -E chdir ${ProjDirPath}/Build nmake
CMake_Debug = cmake -E chdir ${ProjDirPath}/Build cmake -DCMAKE_BUILD_TYPE=Debug ..
----

When using 'cmake -E chdir ${ProjDirPath}/Build', I can using 'Out-of-source' build in Eclipse CDT.

But, If don't use chdir, It's seems no way to implemention 'Out-of-source' build.
(0026091)
Yuchen Deng   
2011-04-04 19:59   
Are you using the Eclipse project generator in cmake ?
---------
No, I am using MSVC with eclipse, then CMake is a powerful build system.
I can generator NMake Makefile or VS Project like below 'Make Target' command.

CMake_MinSizeRel = cmake -E chdir ${ProjDirPath}/Build cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ..

(0026452)
Alex Neundorf   
2011-05-06 17:08   
There should be a "Eclipse CDT4 - NMake Makefiles" available. If you run this from a shell where the MSVC environment has been set, it should work. Did you try that ?

Alex
(0026456)
Yuchen Deng   
2011-05-06 23:06   
No, I don't like "Eclipse CDT4 - NMake Makefiles" .
I am only like "NMake Makefiles", It's more liberal.
And I can using CDT 8.0 feature.
(0026457)
Alex Neundorf   
2011-05-07 03:21   
Ok, then there is nothing to do about this in the Eclipse generator, and I changing code somewhere else in cmake only to improve the log window output in Eclipse (while you are not using what is intended to be used for Eclipse) is nothing I will do.

Alex