diff options
author | Brad King <brad.king@kitware.com> | 2019-03-29 13:11:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-29 13:11:41 (GMT) |
commit | c690e11a56d713d4137e8a719c26269bd18e8030 (patch) | |
tree | 15477c0dd1df4717ddec0b20257d12c9f1074d32 /Modules/CMakeParseImplicitIncludeInfo.cmake | |
parent | 5674018cc6e7f1823a5baec7e4732cbd64f28795 (diff) | |
parent | dad86f1873f6930759795785b5ee4da51ea2050c (diff) | |
download | CMake-c690e11a56d713d4137e8a719c26269bd18e8030.zip CMake-c690e11a56d713d4137e8a719c26269bd18e8030.tar.gz CMake-c690e11a56d713d4137e8a719c26269bd18e8030.tar.bz2 |
Merge topic 'implicit-includes'
dad86f1873 ParseImplicitIncludeInfo: Canonicalize implicit include dirs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michel Zou <xantares09@hotmail.com>
Merge-request: !3157
Diffstat (limited to 'Modules/CMakeParseImplicitIncludeInfo.cmake')
-rw-r--r-- | Modules/CMakeParseImplicitIncludeInfo.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake index 6d7732d..977debb 100644 --- a/Modules/CMakeParseImplicitIncludeInfo.cmake +++ b/Modules/CMakeParseImplicitIncludeInfo.cmake @@ -212,15 +212,27 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var) endif() endforeach() + set(implicit_dirs "") + foreach(d IN LISTS implicit_dirs_tmp) + if(IS_ABSOLUTE "${d}") + get_filename_component(dir "${d}" ABSOLUTE) + list(APPEND implicit_dirs "${dir}") + string(APPEND log " collapse include dir [${d}] ==> [${dir}]\n") + else() + string(APPEND log " skipping relative include dir [${d}]\n") + endif() + endforeach() + list(REMOVE_DUPLICATES implicit_dirs) + # Log results. if(state STREQUAL done) - string(APPEND log " implicit include dirs: [${implicit_dirs_tmp}]\n") + string(APPEND log " implicit include dirs: [${implicit_dirs}]\n") else() string(APPEND log " warn: unable to parse implicit include dirs!\n") endif() # Return results. - set(${dir_var} "${implicit_dirs_tmp}" PARENT_SCOPE) + set(${dir_var} "${implicit_dirs}" PARENT_SCOPE) set(${log_var} "${log}" PARENT_SCOPE) set(${state_var} "${state}" PARENT_SCOPE) |