Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake: How to suppress "Entering directory" messages?

I have a project with different sub-modules. Each sub-module has a CMakeLists.txt and I have a general CMakeLists.txt at the root of the project.

When I run cmake --build [...] or make [...], it recursively builds sub-modules as expected but it prints verbose like this:

make[2]: Entering directory '/some/path/'
make[2]: Entering directory '/some/path/'
make[2]: Leaving directory '/some/path/'
make[2]: Leaving directory '/some/path/'
...

What I have tried

  • Explicitly turn off cmake/make verbose by adding set(CMAKE_VERBOSE_MAKEFILE OFF) in the general CMakeLists.txt.
  • make [...] --no-print-directory
  • cmake [...] -- [...] --no-print-directory

The --no-print-directory flag removes these messages as intended, but I used to not have to specify this flag in previous projects. I would prefer to avoid using this flag to get the same results as before.

Versions

GNU Make 4.3
cmake version 3.16.4

like image 667
MrYannKee Avatar asked Feb 28 '20 10:02

MrYannKee


1 Answers

You can use

MAKEFLAGS += --no-print-directory

Described in the GNU make manual

like image 86
Paul Brian - Software Build Avatar answered Nov 11 '22 18:11

Paul Brian - Software Build