File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,16 @@ add_subdirectory(sam)
33
44# scripts
55add_subdirectory (script)
6+
7+ # Edit python scripts if the host is built with python3
8+ if (${TUTTLE_PYTHON_VERSION} VERSION_GREATER "3" )
9+ set (BASH_PYTHON2 "#!/usr/bin/env python" )
10+ set (BASH_PYTHON3 "#!/usr/bin/env python3" )
11+
12+ file (GLOB_RECURSE PYTHON_APPS sam/*.py script/*.py)
13+ foreach (PYTHON_APP ${PYTHON_APPS} )
14+ file (READ "${PYTHON_APP} " APP_CONTENT_PYTHON2)
15+ string (REGEX REPLACE ${BASH_PYTHON2} ${BASH_PYTHON3} APP_CONTENT_PYTHON3 "${APP_CONTENT_PYTHON2} " )
16+ file (WRITE "${PYTHON_APP} " "${APP_CONTENT_PYTHON3} " )
17+ endforeach ()
18+ endif ()
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ if (TuttleBoost_FOUND)
131131
132132 # Find python c libs
133133 find_package (PythonLibs ${TUTTLE_PYTHON_VERSION} )
134+ set (TUTTLE_PYTHON_VERSION ${PYTHONLIBS_VERSION_STRING} )
134135 include_directories (${PYTHON_INCLUDE_DIRS} )
135136
136137 # Numpy
You can’t perform that action at this time.
0 commit comments