How to print compile and link commands in CMake?

1

I have a project that uses CMake and would like to print the build commands it generates. How to do this?

    
asked by anonymous 17.06.2015 / 20:50

2 answers

1

If you want the always compilation commands to be printed, put the following line in CMakeLists.txt :

SET(CMAKE_VERBOSE_MAKEFILE ON)

If you want to print the compilation commands only a few times, after running CMake, run make as follows:

make VERBOSE=1
    
17.06.2015 / 20:50
0

I do not know if I understand the question well, but if you want to print a message like "Generating Objects" or "linking libraries" just put it after each rule

all: dependencia1 dependencia2 ....
    @echo "Gerando executavel"

and it will print this string when you are performing this rule.

    
30.09.2015 / 03:31