How to get cmake to show a percentage progress report?

Hi,Experts
I want to know how to get cmake to show a percentage progress report?
like this
[ 66%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/DFAEmitter.cpp.o
[ 66%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/DFAPacketizerEmitter.cpp.o
[ 66%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/DirectiveEmitter.cpp.o

Look forward reply!

Regards,
Xie

I don’t think CMake can do this.
I believe during the processing CMake has no idea how much there’s left because of the things that can be included conditionally, so there is no way to report a meaningful progress.

I using Ninja as a generator, so can Ninja do this?
And how did others do it?
Thanks.

Last time I used Makefile generator, CMake pre-calculated this.

For ninja, you can configure NINJA_STATUS environment variable.

How should I configure ninja env? Can you describe more detail?
Thank you very much.

https://ninja-build.org/manual.html#_environment_variables

yes, I has found it, but it looks like dont work normally.
I set NINJA_STATUS in toolchain.cmake file like this set(ENV{NINJA_STATUS} “[%p/%f/%t]”)
please correct me if I am wrong on this.
Thanks.

You set environment variables in your shell (the program that runs ninja). This is not CMake!

Get it, and it looks like work normally.
Thank you very much.
Regards,
Xie

Meh, I misunderstood the question. :frowning:

HH, Hendrik Sattler’s reply is right.