Skip to content

Commit

Permalink
Merge pull request #150 from robotology/fix/python
Browse files Browse the repository at this point in the history
Fix the python package when installed from cmake
  • Loading branch information
Nicogene authored Apr 7, 2022
2 parents 73661ed + b632e86 commit 7a32fa8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo

## [Unreleased]

### Fixed
* In Python helper library, fix the get_models_path() when the `icub_models` package is installed with the robotology-superbuild (https://github.com/robotology/icub-models/pull/149).
### Fixed
* In Python helper library, fix the `get_models_path()` when the `icub_models` package is installed with the robotology-superbuild (https://github.com/robotology/icub-models/pull/149, https://github.com/robotology/icub-models/pull/150).
* Fix the `PYTHON_ABSOLUTE_INSTDIR` when a relative `PYTHON_INSTDIR` is detected (https://github.com/robotology/icub-models/pull/150)

## [1.23.2] - 2020-03-31

Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(ICUB_MODELS_USES_PYTHON)
if(IS_ABSOLUTE ${PYTHON_INSTDIR})
set(PYTHON_ABSOLUTE_INSTDIR "${PYTHON_INSTDIR}")
else()
set(PYTHON_ABSOLUTE_INSTDIR "${CMAKE_INSTALL_DIR}/${PYTHON_INSTDIR}")
set(PYTHON_ABSOLUTE_INSTDIR "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTDIR}")
endif()
file(RELATIVE_PATH ICUB_MODELS_CXX_PYTHON_INSTALL_RELATIVE_DIR ${PYTHON_ABSOLUTE_INSTDIR} ${CMAKE_INSTALL_PREFIX})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/icub_models/icub_models.py"
Expand Down
2 changes: 1 addition & 1 deletion python/icub_models/icub_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_models_path() -> pathlib.Path:
else:
root = pathlib.Path(__file__).parent.parent.parent.parent.parent
else:
root = pathlib.Path(__file__) / pathlib.Path(relative_path)
root = pathlib.Path(__file__).parent / pathlib.Path(relative_path)

return (root / "share" / "iCub" / "robots").resolve()

Expand Down

0 comments on commit 7a32fa8

Please sign in to comment.