CMake 3.14+ you can simply specify the verbosity of the build tool.
# Configure your project
cmake -S . -B build/
# Build your project with verbose output
# This will allow you to see the exact commands being used.
# And this works with Makefiles, Ninja, Visual Studio, etc.
cmake --build build --verbose
Before CMake 3.14
When you run make, add VERBOSE=1
to see the full command output. For example:
cmake .
make VERBOSE=1
Or you can add -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
to the cmake command for permanent verbose command output from the generated Makefiles.
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .
make
To reduce some possibly less-interesting output you might like to use the following options. The option CMAKE_RULE_MESSAGES=OFF
removes lines like [ 33%] Building C object..., while --no-print-directory
tells make to not print out the current directory filtering out lines like make[1]: Entering directory
and make[1]: Leaving directory
.
cmake -DCMAKE_RULE_MESSAGES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .
make --no-print-directory
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…