Skip to content

Commit

Permalink
[utils] Enforce Python choice for mc_log_ui
Browse files Browse the repository at this point in the history
Closes #268
  • Loading branch information
gergondet committed Jul 8, 2022
1 parent 8239ca1 commit 5c98961
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#
# Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
# Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL
#

if(NOT DEFINED MC_LOG_UI_PYTHON_EXECUTABLE)
set(MC_LOG_UI_PYTHON_EXECUTABLE "python")
if(PYTHON_BINDING_FORCE_PYTHON3)
set(MC_LOG_UI_PYTHON_EXECUTABLE "python3")
elseif(PYTHON_BINDING_FORCE_PYTHON2)
set(MC_LOG_UI_PYTHON_EXECUTABLE "python2")
else()
set(MC_LOG_UI_PYTHON_EXECUTABLE "python")
endif()
endif()

find_package(Boost REQUIRED COMPONENTS program_options timer)
Expand Down
3 changes: 2 additions & 1 deletion utils/config_build_and_install.focal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ then
export APT_DEPENDENCIES="$APT_DEPENDENCIES python-is-python3"
fi

export MC_LOG_UI_PYTHON_EXECUTABLE=python3

mc_rtc_extra_steps()
{
if [ "x$PYTHON_FORCE_PYTHON2" == xON || "x$PYTHON_BUILD_PYTHON2_AND_PYTHON3" == xON || "x$PYTHON_VERSION_MAJOR" == x2 ]
Expand All @@ -22,5 +24,4 @@ mc_rtc_extra_steps()
# pip3 gets overwritten by the get-pip.py script, but the python3-pip package remains installed. This usures that pip3 remains cleanly installed.
sudo apt-get install --reinstall -y python3-pip
fi
export MC_LOG_UI_PYTHON_EXECUTABLE=python3
}
2 changes: 1 addition & 1 deletion utils/config_build_and_install.jammy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ fi
export PYTHON_FORCE_PYTHON2="false"
export PYTHON_FORCE_PYTHON3="true"
export PYTHON_BUILD_PYTHON2_AND_PYTHON3="false"
export MC_LOG_UI_PYTHON_EXECUTABLE=python3

mc_rtc_extra_steps()
{
export MC_LOG_UI_PYTHON_EXECUTABLE=python3
# Fix GEOS installation: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010002
if [ ! -f /usr/include/geos/geom/Coordinate.inl ]
then
Expand Down

0 comments on commit 5c98961

Please sign in to comment.