Skip to content

Commit

Permalink
Do not redefine GZ_PYTHON_INSTALL_PATH if it is already defined (#393)
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio Traversaro <[email protected]>
  • Loading branch information
traversaro authored Oct 4, 2023
1 parent 0472ba0 commit 0f69062
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ endif()
# Find Python
find_package(Python3 REQUIRED COMPONENTS Interpreter)

if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(USE_DIST_PACKAGES_FOR_PYTHON)
string(REPLACE "site-packages" "dist-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITELIB})
if(NOT GZ_PYTHON_INSTALL_PATH)
if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(USE_DIST_PACKAGES_FOR_PYTHON)
string(REPLACE "site-packages" "dist-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITELIB})
else()
# Python3_SITELIB might use dist-packages in some platforms
string(REPLACE "dist-packages" "site-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITELIB})
endif()
else()
# Python3_SITELIB might use dist-packages in some platforms
string(REPLACE "dist-packages" "site-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITELIB})
# If not a system installation, respect local paths
set(GZ_PYTHON_INSTALL_PATH ${GZ_LIB_INSTALL_DIR}/python)
endif()
else()
# If not a system installation, respect local paths
set(GZ_PYTHON_INSTALL_PATH ${GZ_LIB_INSTALL_DIR}/python)
endif()
#============================================================================
# Configure the build
Expand Down

0 comments on commit 0f69062

Please sign in to comment.