summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/GrSwig.cmake10
-rw-r--r--gnuradio-core/CMakeLists.txt1
-rw-r--r--gnuradio-core/src/lib/swig/CMakeLists.txt3
3 files changed, 9 insertions, 5 deletions
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index 3d1c5d47f0..b9bf0bb0b9 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -205,21 +205,25 @@ file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py "
import os, sys, re
-include_matcher = re.compile('[#|%]include\\s*[<|\"](.*)[>|\"]')
+i_include_matcher = re.compile('%(include|import)\\s*[<|\"](.*)[>|\"]')
+h_include_matcher = re.compile('#(include)\\s*[<|\"](.*)[>|\"]')
include_dirs = sys.argv[2].split(';')
def get_swig_incs(file_path):
+ if file_path.endswith('.i'): matcher = i_include_matcher
+ else: matcher = h_include_matcher
file_contents = open(file_path, 'r').read()
- return include_matcher.findall(file_contents, re.MULTILINE)
+ return matcher.findall(file_contents, re.MULTILINE)
def get_swig_deps(file_path, level):
deps = [file_path]
if level == 0: return deps
- for inc_file in get_swig_incs(file_path):
+ for keyword, inc_file in get_swig_incs(file_path):
for inc_dir in include_dirs:
inc_path = os.path.join(inc_dir, inc_file)
if not os.path.exists(inc_path): continue
deps.extend(get_swig_deps(inc_path, level-1))
+ break #found, we dont search in lower prio inc dirs
return deps
if __name__ == '__main__':
diff --git a/gnuradio-core/CMakeLists.txt b/gnuradio-core/CMakeLists.txt
index 396712ba74..e5502b1dfb 100644
--- a/gnuradio-core/CMakeLists.txt
+++ b/gnuradio-core/CMakeLists.txt
@@ -59,6 +59,7 @@ GR_SET_GLOBAL(GNURADIO_CORE_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/src/lib/swig
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/swig
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/hier
+ ${Boost_INCLUDE_DIRS}
)
GR_SET_GLOBAL(GNURADIO_CORE_SWIG_INCLUDE_DIRS
diff --git a/gnuradio-core/src/lib/swig/CMakeLists.txt b/gnuradio-core/src/lib/swig/CMakeLists.txt
index 2c97588686..6a989616d1 100644
--- a/gnuradio-core/src/lib/swig/CMakeLists.txt
+++ b/gnuradio-core/src/lib/swig/CMakeLists.txt
@@ -25,10 +25,9 @@ include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
set(GR_SWIG_INCLUDE_DIRS
- ${Boost_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
${GRUEL_INCLUDE_DIRS}
${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR}
)
set(GR_SWIG_LIBRARIES gnuradio-core)