use absolute path to test files - accroding to CMake docs EXISTS behavior is well-defined only for full paths.

This commit is contained in:
dvirtz 2017-05-18 15:51:44 +03:00
parent d271683c14
commit a49fa0edbe
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,8 @@ endfunction()
# Worker function
function(ParseFile SourceFile TestTarget)
# accroding to CMake docs EXISTS behavior is well-defined only for full paths.
get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
if(NOT EXISTS ${SourceFile})
message(WARNING "Cannot find source file: ${SourceFile}")
return()