From e87705fab34ff23f2d117d0185f19fc8698ff081 Mon Sep 17 00:00:00 2001 From: MARUYAMA Norihiro Date: Tue, 24 Oct 2023 15:49:48 +0900 Subject: [PATCH] Use python bundled in platformIO inside colcon build command by cmake option. (#108) --- microros_utils/library_builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microros_utils/library_builder.py b/microros_utils/library_builder.py index 766d8d3..1077400 100644 --- a/microros_utils/library_builder.py +++ b/microros_utils/library_builder.py @@ -100,7 +100,7 @@ def download_dev_environment(self): def build_dev_environment(self): print("Building micro-ROS dev dependencies") - command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF".format(self.dev_folder, self.python_env) + command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF -DPython3_EXECUTABLE=`which python`".format(self.dev_folder, self.python_env) result = run_cmd(command, env=self.env) if 0 != result.returncode: @@ -174,7 +174,7 @@ def build_mcu_environment(self, meta_file, toolchain_file, user_meta = ""): print("Building micro-ROS library") common_meta_path = self.library_folder + '/metas/common.meta' - colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={}'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file) + colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={} -DPython3_EXECUTABLE=`which python`'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file) command = "cd {} && . {}/install/setup.sh && {}".format(self.mcu_folder, self.dev_folder, colcon_command) result = run_cmd(command, env=self.env)