[CMake] How to suppress output like "-- Checking whether C ", etc.?

Peng Yu pengyu.ut at gmail.com
Mon Aug 13 17:38:10 EDT 2012


On Mon, Aug 13, 2012 at 3:37 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> Hi,
>
> you can't tell cmake to do this and usually you don't want to either.
> These are status messages indicating what cmake is using so you can

According to the common linux philosophy, mostly status messages like
this are suppressed in other tools unless otherwise instructed.
Therefore, I think that it may be better to suppress these messages by
default and add an option in cmake to enable them when users want
these messages. After all, when cmake runs successfully, these
messages are useless and just make the output look ugly.

> easily spot if cmake chose the wrong compiler or found a library in a
> place where you didn't expect it.
>
> To suppress all non-error output you can do:
>
> cmake ../ >/dev/null
>
> on *nix systems. That way only errors in your cmake files are being shown.
>
> Andreas
>
> On Mon, Aug 13, 2012 at 9:42 PM, Peng Yu <pengyu.ut at gmail.com> wrote:
>> Hi,
>>
>> I just want "Hello World!" to be shown and everything else be
>> suppressed. "-Wno-dev" seems not relevant. I don't find other options
>> seem to be useful in the manual. In case I miss anything in the
>> manual, is there an option to suppress these messages? Thanks!
>>
>> ~/linux/test/cmake/lang/command/message/build$ cat ../src1/CMakeLists.txt
>> message("Hello World!")
>> ~/linux/test/cmake/lang/command/message/build$ rm -rf *
>> ~/linux/test/cmake/lang/command/message/build$ cmake ../src1/
>> -- The C compiler identification is GNU 4.2.1
>> -- The CXX compiler identification is GNU 4.2.1
>> -- Checking whether C compiler has -isysroot
>> -- Checking whether C compiler has -isysroot - yes
>> -- Checking whether C compiler supports OSX deployment target flag
>> -- Checking whether C compiler supports OSX deployment target flag - yes
>> -- Check for working C compiler: /usr/bin/gcc
>> -- Check for working C compiler: /usr/bin/gcc -- works
>> -- Detecting C compiler ABI info
>> -- Detecting C compiler ABI info - done
>> -- Checking whether CXX compiler has -isysroot
>> -- Checking whether CXX compiler has -isysroot - yes
>> -- Checking whether CXX compiler supports OSX deployment target flag
>> -- Checking whether CXX compiler supports OSX deployment target flag - yes
>> -- 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
>> Hello World!
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to:
>> /Users/pengy/linux/test/cmake/lang/command/message/build
>>
>>
>> --
>> Regards,
>> Peng
>> --
>>
>> 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



-- 
Regards,
Peng


More information about the CMake mailing list