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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
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
Reply | Threaded
Open this post in threaded view
|

Re: How to suppress output like "-- Checking whether C ", etc.?

Andreas Pakulat-2
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
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 <[hidden email]> 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
--

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
Reply | Threaded
Open this post in threaded view
|

Re: How to suppress output like "-- Checking whether C ", etc.?

Peng Yu
On Mon, Aug 13, 2012 at 3:37 PM, Andreas Pakulat <[hidden email]> 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 <[hidden email]> 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
--

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
Reply | Threaded
Open this post in threaded view
|

Re: How to suppress output like "-- Checking whether C ", etc.?

Bill Hoffman
On 8/13/2012 5:38 PM, Peng Yu wrote:
> 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.
This is really modeled after autoconf and its generated configure
scripts.  I don't think there is a way to disable the output of a
configure script as it does checks.  I think this is very common to
linux users doing builds.  Also, the information is useful as it gives a
progress to the user, and something to report to developers when
something goes wrong.

-Bill
--

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