Ever wanted to get more information out of a build process controlled by
We sure did and this is how we did it:
Option 1 – Change your CMakeLists.txt files
As our first option, we present updating your
CMakeLists.txt file to include the following configuration line:
This option by itself is enough to enable verbosity.
A caveat with this option is that the configuration is not passed on to other
CMakeLists.txt files that are included to the build using the command
add_subdirectory () from the master
Thus, you need to copy the configuration file to each
CMakeLists.txt file you want to be verbose.
Option 2 – Add the variable VERBOSE=1 to your make command
Assuming you are using a terminal and you are in the folder where you want to build your project.
After you execute the command
execute your make command using the
VERBOSE=1 variable as follows
The caveat of this solution is that EVERYTHING becomes verbose, so you could have too many output data.
Option 3 – Add the variable -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON to your cmake command
Adding the option
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON to the
cmake command, it will enable verbosity on all generated
So, assuming you are in the folder where you want to make the build, execute the following to generate the
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON $path_to_project_source;
and then just issue
make to perform the build with verbose output.
Please note, you cannot disable verbose output using
make VERBOSE=0 after you enable it through
cmake, you need to execute the
cmake command again without the
To remove the ‘building’ and ‘linking’ lines from the output
[ 10%] Building C object libs/segmentation/CMakeFiles/segments.dir/list_helpers.c.o and [ 30%] Linking C static library libsegments.a
add the option
-DCMAKE_RULE_MESSAGES:BOOL=OFF to your
cmake command to disable them.
cmake -DCMAKE_RULE_MESSAGES:BOOL=OFF $path_to_project_source;
To remove the ‘Entering directory’ and ‘Leaving directory’ lines from the output
make: Leaving directory '/home/george/Projects/3rd Party/segments222bit/cmake-build-debug' and make: Entering directory '/home/george/Projects/3rd Party/segments222bit/cmake-build-debug'
add the option
--no-print-directory to your
make command to disable them.
This post is also available in: Αγγλικα