[CMake] "cmake --build ." and colors

Gregoire Aujay gaujay at movea.com
Thu May 16 04:31:18 EDT 2013


Hello,

I am still trying to find a solution to get those colors displayed. Especially when I read that :) http://www.phoronix.com/scan.php?page=news_item&px=MTM2MzI
I came to the conclusion that the only way to do so is to run the native build tool directly from the command line.

So I thougth of a solution: an option could be added to cmake command line to output the native command corresponding to the cmake --build.
Then I could write that output to a script and run it.

	cmake --build . --target foo -- -j3
Would output something like that when using Ninja generator:
	<path_to_ninja> foo -j3


What do you think?

Regards,
Gregoire



-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Andreas Mohr
Sent: samedi 4 mai 2013 14:48
To: Leif Walsh
Cc: cmake at cmake.org; Andreas Mohr
Subject: Re: [CMake] "cmake --build ." and colors

On Sat, May 04, 2013 at 05:12:14AM -0700, Leif Walsh wrote:
>    cmake --build . -- -jN
>    Extra args after -- are passed through to the build tool. Doesn't work if
>    the tool expects something different though.

Ah, cool (took note to improve my script).
While -- is some pretty standard mechanism, CMake usage screen (dito man page! Likely same info source...) does not explicitly document it, though (will add docs, currently doing that anyway).

It's of course somewhat bitter to have a nice tool-abstracted --build mechanism yet then still having to know tool-specific parameters in a script. Talk about incomplete abstraction.


>    I think the colors and carriage returns (without line feeds) are lost
>    because the build tool sees its controlling terminal is cmake, not a real
>    terminal program capable of showing color or redrawing, so it doesn't
>    output them. Cmake may be logging this stuff too (to send to cdash for
>    example) so this is kind of a responsible choice.

Indeed, that possibly gets decided via the controlling terminal's features.

Andreas Mohr
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake




More information about the CMake mailing list