[CMake] Saving clang output to file when cmake is used with CLion

mike lojkovic mikelojkovic at gmail.com
Wed Apr 12 20:35:53 EDT 2017


I have a script I'm using to figure out which headers should be in my
precompiled header. It requires the clang -H flag passed to work. I'm
able to get the output on the console without issue, but can't figure
out how to just pass clang's output to a file for my script to
analyze. redirecting the console output to a file with ">" won't work
since I'm compiling from CLion. Is there a way to do this from within
a CMakeLists.txt?  I'm thinking something like tee would work, but
can't find a variable to chain to tee.


More information about the CMake mailing list