Update logic for sysroot in detected implicit include directories

Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation.  In this case the paths under the sysroot
should already have the sysroot prefix so we should no longer have to
add the sysroot prefix.  However, it is also possible for project code
to add its own paths to `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
without the sysroot prefix and expect the historical addition of the
sysroot prefix to be preserved.

Try to account for both cases by conditionally adding the sysroot prefix
on implicit include directories that do not already have it.
1 file changed