From bbf59541fac918eecfff9edb6779a17c2407fdc0 Mon Sep 17 00:00:00 2001 From: coarsedamavand <37965683+coarsedamavand@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:08:00 -0400 Subject: [PATCH 1/2] Added Note to Windows-Development-Setup.rst Added Note under the 'build the code in the workspace' section: https://docs.ros.org/en/rolling/Installation/Alternatives/Windows-Development-Setup.html#build-the-code-in-the-workspace Informs users of cmake-args useful in setting specific Python directories for the windows build on a system with multiple Python installations. --- .../Installation/Alternatives/Windows-Development-Setup.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/Installation/Alternatives/Windows-Development-Setup.rst b/source/Installation/Alternatives/Windows-Development-Setup.rst index 6d49949fce..6750baeabf 100644 --- a/source/Installation/Alternatives/Windows-Development-Setup.rst +++ b/source/Installation/Alternatives/Windows-Development-Setup.rst @@ -93,6 +93,12 @@ To build the ``\{DISTRO}`` folder tree: We're using ``--merge-install`` here to avoid a ``PATH`` variable that is too long at the end of the build. If you're adapting these instructions to build a smaller workspace then you might be able to use the default behavior which is isolated install, i.e. where each package is installed to a different folder. +.. note:: + + If multiple versions of Python 3 are installed, cmake-args can be set in order to ensure only the desired Python 3 executable and library folders are used for the build: + ``colcon build --merge-install --cmake-args -DPython3_ROOT_DIR= -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_REGISTRY=NEVER`` +where ```` is e.g. ``C:\Python38`` (the location Chocolatey will install Python) + .. note:: If you are doing a debug build use ``python_d path\to\colcon_executable`` ``colcon``. From 6fa21dbd2f6a93fa010cd3be180be5c83f3306a4 Mon Sep 17 00:00:00 2001 From: coarsedamavand <37965683+coarsedamavand@users.noreply.github.com> Date: Mon, 27 May 2024 17:13:11 -0400 Subject: [PATCH 2/2] Update CMake args fo Python specification Following testing, updated which CMake args are necessary to avoid build errors arising from incorrect python installs being found and used. --- .../Installation/Alternatives/Windows-Development-Setup.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Installation/Alternatives/Windows-Development-Setup.rst b/source/Installation/Alternatives/Windows-Development-Setup.rst index 3b2672d5ef..8082a97956 100644 --- a/source/Installation/Alternatives/Windows-Development-Setup.rst +++ b/source/Installation/Alternatives/Windows-Development-Setup.rst @@ -95,9 +95,9 @@ To build the ``\{DISTRO}`` folder tree: .. note:: - If multiple versions of Python 3 are installed, cmake-args can be set in order to ensure only the desired Python 3 executable and library folders are used for the build: - ``colcon build --merge-install --cmake-args -DPython3_ROOT_DIR= -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_REGISTRY=NEVER`` -where ```` is e.g. ``C:\Python38`` (the location Chocolatey will install Python) + If multiple versions of Python 3 are installed and added to path, cmake-args can be set in order to ensure only the desired Python 3 executable and library folders are used for the build: + ``colcon build --merge-install --cmake-args -DPYTHON_EXECUTABLE= -DPython3_ROOT_DIR= -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_REGISTRY=NEVER`` +where ```` is e.g. ``C:\Python38\python.exe``, and ```` is e.g. ``C:\Python38`` (the location Chocolatey will install Python) .. note::