From 193cf71233ae2db22647c9d2fffacc80071212b7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Sep 2018 00:03:26 -0600 Subject: [PATCH] CMake: Pass Python extension files to Interrogate with relative paths This makes sure absolute paths don't show up in #include, since Interrogate doesn't (currently) use the proper representation for this. (See #386) --- cmake/macros/Interrogate.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5d83cea25b..4d88310947 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -164,6 +164,12 @@ function(interrogate_sources target output database language_flags) endif() endforeach(source) + # Also add extensions, in relative-path form + foreach(extension ${extensions}) + file(RELATIVE_PATH rel_extension "${srcdir}" "${extension}") + list(APPEND scan_sources "${rel_extension}") + endforeach(extension) + # Interrogate also needs the include paths, so we'll extract them from the # target. These are available via a generator expression. @@ -224,7 +230,6 @@ function(interrogate_sources target output database language_flags) -S "${PYTHON_INCLUDE_DIRS}" ${include_flags} ${scan_sources} - ${extensions} DEPENDS host_interrogate ${sources} ${extensions} ${nfiles} COMMENT "Interrogating ${target}" )