CTestCoverageCollectGCOV: Fix handling of international characters

When loading the list of target support directories, read the file
with UTF-8 encoding since that is what CMake writes into the file.
This allows us to support international characters in the path to
the build tree containing the target support directories.
This commit is contained in:
Brad King 2015-02-03 10:36:17 -05:00
parent 8caa4e72ab
commit 03c0812c41
1 changed files with 2 additions and 1 deletions

View File

@ -90,7 +90,8 @@ function(ctest_coverage_collect_gcov)
# look for gcda files in the target directories
# could do a glob from the top of the binary tree but
# this will be faster and only look where the files will be
file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs)
file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs
ENCODING UTF-8)
foreach(target_dir ${target_dirs})
file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
list(LENGTH gfiles len)