CMake/file.cmake: Handle leading space from wc output

This commit is contained in:
Erik de Castro Lopo 2016-07-03 08:21:22 +10:00
parent 6776ceafa8
commit cb47664a80

View File

@ -15,6 +15,7 @@ function (file_line_count filename variable)
execute_process (
COMMAND ${WC} -l ${filename}
COMMAND ${SED} "s/^[ ]*//" # wc output on Mac has leading whitespace.
COMMAND ${SED} "s/ .*//"
OUTPUT_VARIABLE line_count
)