Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake, print compile/link commands

Tags:

makefile

cmake

Can somebody please enlighten me as to what the command line flag to CMake might be that will make it print out all the compile/link commands it executes?

I can't find this anywhere in the documentation. Many hours of my life have just evaporated. I'd just like to verify it's doing what I think it is, (then banish the infernal build system altogether and replace it with a GNU Makefile). Thank you!

like image 811
mr grumpy Avatar asked Jul 31 '10 17:07

mr grumpy


1 Answers

The verbose argument should do what you want.

Content copied (with format adjusted slightly) here for future reference:

CMake/Verbose output

CMake has a nice colored output which hides the commandline. This is pretty to look at in the long run but sometimes when you write your configurations you want to know if you got all the compiler flags right. There is two ways to disable the pretty output, well, it's essentialy the same but still two different ways.

The first way is to simply run make with the additional argument "VERBOSE=1". This will show each command being run for this session, which is the most useful way to see if the flags is correct:

make VERBOSE=1

The second way is to permanently disable the pretty output in your CMakeLists.txt by setting CMAKE_VERBOSE_MAKEFILE:

set( CMAKE_VERBOSE_MAKEFILE on )

Content is available under Attribution-ShareAlike 2.5 unless otherwise noted.

like image 79
You Avatar answered Nov 13 '22 04:11

You