Ignore Qt specific files
Brought to you by:
alnd
Qt uses MOC (Meta-Object Compiler) which produce bunch of additional files inside build directory. With default settings cloc ignores most of them, but counts files:
#build_directory#/Makefile
#build_directory#/moc_mainwindow.cpp
#build_directory#/ui_mainwindow.h
The problem is that #build_directory# can be anything the programmer wants. Default value is: "build-#projectname#-#toolchain#-#(Debug|Release)#".
Actual build directory can be extracted from the #projectname#.pro.user file like this: http://regex101.com/r/oC0vJ3
I have attached *.pro.user file for reference.
Anonymous
Wow, that's convoluted. I'm not keen to implement this.
Not to leave you empty handed, you could use cloc's --exclude-dir option to avoid counts in these directories. This one liner
produces
which is the start of an invocation that will skip the contents of the build directories.