Skip to content

Commit

Permalink
uss python_install_dir (#178)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <[email protected]>
  • Loading branch information
pac48 authored Feb 26, 2024
1 parent cf8d2fb commit 4b50b98
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,9 @@ function(generate_parameter_module LIB_NAME YAML_FILE)
set(LIB_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME})
file(MAKE_DIRECTORY ${LIB_INCLUDE_DIR})

find_package(PythonInterp REQUIRED)
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "import sys;v = sys.version.split()[0];v = v.split('.');print(f'python{v[0]}.{v[1]}')"
OUTPUT_VARIABLE PYTHON_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(PARAM_HEADER_FILE ${CMAKE_INSTALL_PREFIX}/local/lib/${PYTHON_VERSION}/dist-packages/${PROJECT_NAME}/${LIB_NAME}.py)

find_package(ament_cmake_python)
ament_get_python_install_dir(python_install_dir)
set(PARAM_HEADER_FILE ${CMAKE_INSTALL_PREFIX}/${python_install_dir}/${PROJECT_NAME}/${LIB_NAME}.py)

# Generate the module for the python
add_custom_command(
Expand Down

0 comments on commit 4b50b98

Please sign in to comment.