[cmake-developers] [PATCH] stage/compact-status-log

Adam Strzelecki ono at java.pl
Mon Sep 22 15:08:15 EDT 2014


> IMO that is too much infrastructure to solve what is essentially
> a cosmetic problem.

Well, IMHO it is usability problem, because cmake emits simply too much (redundant) information.

FYI I have pushed new stage/compact-status-log which does include this automatic subsequent status log line merging facility without using any ANSI escape sequences or any changes to .cmake files and it works with any UNIX having pipe, select & pthreads. What's more good it works regardless if cmake output is piped to file or goes directly terminal.

Here's a commit log:

commit e464a698e773dcbaba26b5af0327561312717b58
Author: Adam Strzelecki <ono at java.pl>
Date:   Mon Sep 22 20:53:48 2014 +0200

    Automatically compact two subsequent status lines
    
    This is done with background thread acting as stdout/stderr proxy monitoring
    subsequent lines emitted to stdout. Only lines beginning with "--" (status
    lines) are considered.
    
    If previously emitted line is a prefix to currently emitted line then this line
    gets merged, e.g.:
    
       -- Looking for iconv.h
       -- Looking for iconv.h - Found
    
    Is replaced with:
    
       -- Looking for iconv.h - Found
    
    However if there is any output both on stdout and stderr in between then the
    merging is not executed, e.g:
    
       -- Looking for iconv.h
       -- Cannot compile test.c
       -- Looking for iconv.h - Not found
    
    This currently works only on UNIX.


And the results when running cmake on cmake:

$ /tmp/cmake.PTeJch9J/bin/cmake ~/Code/SDK/cmake
-- The C compiler identification is AppleClang 6.0.0.6000054
-- The CXX compiler identification is AppleClang 6.0.0.6000054
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info - done
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info - done
-- Looking for C++ include iostream - found
-- Check for STD namespace - found
-- Check for ANSI scope - found
-- Check for sstream - found
-- Looking for unsetenv - found
-- Looking for environ - not found
-- Checking whether header cstdio is available - yes
-- Checking for Large File Support - yes
-- Checking whether STL classes are in std namespace - yes
-- Checking whether ANSI stream headers are available - yes
-- Checking whether ANSI streams are in std namespace - yes
-- Checking whether ANSI string stream is available - yes
-- Checking whether header cstddef is available - yes
-- Checking whether stl string has operator!= for char* - yes
-- Checking whether stl has iterator_traits - yes
-- Checking whether stl has standard template allocator - yes
-- Checking for rebind member of stl allocator - yes
-- Checking for non-standard argument to stl allocator<>::max_size - no
-- Checking whether stl containers support allocator objects. - yes
-- Checking whether ios has binary openmode - yes
-- Checking whether "<>" is needed for template friends - yes
-- Checking for member template support - yes
-- Checking for standard template specialization syntax - yes
-- Checking whether argument dependent lookup is supported - yes
-- Checking whether struct stat has st_mtim member - no
-- Checking whether C++ compiler has 'long long' - yes
-- Checking whether C++ compiler has '__int64' - no
-- Checking for C type size macros - compiled
-- Looking for sys/types.h - found
-- Looking for stdint.h - found
-- Looking for stddef.h - found

Versus old non-compact cmake:

$ /Volumes/cmake-3.0.2-Darwin64-universal/CMake.app/Contents/bin/cmake ~/Code/SDK/cmake
-- The C compiler identification is AppleClang 6.0.0.6000054
-- The CXX compiler identification is AppleClang 6.0.0.6000054
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Check for STD namespace
-- Check for STD namespace - found
-- Check for ANSI scope
-- Check for ANSI scope - found
-- Check for sstream
-- Check for sstream - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for environ
-- Looking for environ - not found
-- Checking whether header cstdio is available
-- Checking whether header cstdio is available - yes
-- Checking for Large File Support
-- Checking for Large File Support - yes
-- Checking whether STL classes are in std namespace
-- Checking whether STL classes are in std namespace - yes
-- Checking whether ANSI stream headers are available
-- Checking whether ANSI stream headers are available - yes
-- Checking whether ANSI streams are in std namespace
-- Checking whether ANSI streams are in std namespace - yes
-- Checking whether ANSI string stream is available
-- Checking whether ANSI string stream is available - yes
-- Checking whether header cstddef is available
-- Checking whether header cstddef is available - yes
-- Checking whether stl string has operator!= for char*
-- Checking whether stl string has operator!= for char* - yes
-- Checking whether stl has iterator_traits
-- Checking whether stl has iterator_traits - yes
-- Checking whether stl has standard template allocator
-- Checking whether stl has standard template allocator - yes
-- Checking for rebind member of stl allocator
-- Checking for rebind member of stl allocator - yes
-- Checking for non-standard argument to stl allocator<>::max_size
-- Checking for non-standard argument to stl allocator<>::max_size - no
-- Checking whether stl containers support allocator objects.
-- Checking whether stl containers support allocator objects. - yes
-- Checking whether ios has binary openmode
-- Checking whether ios has binary openmode - yes
-- Checking whether "<>" is needed for template friends
-- Checking whether "<>" is needed for template friends - yes
-- Checking for member template support
-- Checking for member template support - yes
-- Checking for standard template specialization syntax
-- Checking for standard template specialization syntax - yes
-- Checking whether argument dependent lookup is supported
-- Checking whether argument dependent lookup is supported - yes
-- Checking whether struct stat has st_mtim member

--Adam




More information about the cmake-developers mailing list