Skip to content

Commit 2db2c76

Browse files
Address review: use DYLD_LIBRARY_PATH on macOS, fix trailing slash
Gate the library path variable on APPLE so macOS picks up DYLD_LIBRARY_PATH instead of the ineffective LD_LIBRARY_PATH, and add the missing trailing slash on the gz_msgs_gen/python PYTHONPATH entry to match the line above. Generated-by: Claude <noreply@anthropic.com> Signed-off-by: Taylor Howard <taylorhoward@me.com>
1 parent 43aafe0 commit 2db2c76

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

python/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ if (BUILD_TESTING AND NOT WIN32)
2626
endif()
2727
set(_env_vars)
2828
list(APPEND _env_vars "PYTHONPATH=path_list_prepend:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/")
29-
list(APPEND _env_vars "PYTHONPATH=path_list_prepend:${CMAKE_BINARY_DIR}/gz_msgs_gen/python")
30-
list(APPEND _env_vars "LD_LIBRARY_PATH=path_list_prepend:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
31-
list(APPEND _env_vars "LD_LIBRARY_PATH=path_list_prepend:${CMAKE_BINARY_DIR}/lib")
29+
list(APPEND _env_vars "PYTHONPATH=path_list_prepend:${CMAKE_BINARY_DIR}/gz_msgs_gen/python/")
30+
if(APPLE)
31+
list(APPEND _env_vars "DYLD_LIBRARY_PATH=path_list_prepend:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
32+
list(APPEND _env_vars "DYLD_LIBRARY_PATH=path_list_prepend:${CMAKE_BINARY_DIR}/lib")
33+
else()
34+
list(APPEND _env_vars "LD_LIBRARY_PATH=path_list_prepend:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
35+
list(APPEND _env_vars "LD_LIBRARY_PATH=path_list_prepend:${CMAKE_BINARY_DIR}/lib")
36+
endif()
3237
set_tests_properties(${test}.py PROPERTIES
3338
ENVIRONMENT_MODIFICATION "${_env_vars}")
3439
endforeach()

0 commit comments

Comments
 (0)