dartpy.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
  2. index 37cadf4..bd29874 100644
  3. --- a/python/CMakeLists.txt
  4. +++ b/python/CMakeLists.txt
  5. @@ -6,13 +6,7 @@ if(NOT DART_BUILD_DARTPY)
  6. endif()
  7. # Set up pybind11
  8. -include(FetchContent)
  9. -FetchContent_Declare(
  10. - pybind11
  11. - GIT_REPOSITORY https://github.com/pybind/pybind11
  12. - GIT_TAG v2.12.0
  13. -)
  14. -FetchContent_MakeAvailable(pybind11)
  15. +find_package(pybind11 CONFIG)
  16. if(NOT pybind11_FOUND)
  17. message(WARNING "Disabling [dartpy] due to missing pybind11 >= 2.2.0.")
  18. @@ -22,9 +16,6 @@ endif()
  19. set(DART_DARTPY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/dartpy")
  20. add_subdirectory(dartpy)
  21. -add_subdirectory(tests)
  22. -add_subdirectory(examples)
  23. -add_subdirectory(tutorials)
  24. message(STATUS "")
  25. message(STATUS "[ dartpy ]")
  26. diff --git a/python/dartpy/CMakeLists.txt b/python/dartpy/CMakeLists.txt
  27. index b316e86..d33c16f 100644
  28. --- a/python/dartpy/CMakeLists.txt
  29. +++ b/python/dartpy/CMakeLists.txt
  30. @@ -6,12 +6,7 @@
  31. #
  32. # This file is provided under the "BSD-style" License
  33. -execute_process(COMMAND ${Python3_EXECUTABLE} -c
  34. - "from distutils.sysconfig import get_python_lib;\
  35. - print(get_python_lib(plat_specific=True))"
  36. - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
  37. - OUTPUT_STRIP_TRAILING_WHITESPACE
  38. -)
  39. +set(PYTHON_SITE_PACKAGES "lib/site-packages")
  40. if(NOT IS_ABSOLUTE ${PYTHON_SITE_PACKAGES})
  41. set(PYTHON_SITE_PACKAGES "${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_PACKAGES}")
  42. endif()
  43. @@ -29,7 +24,6 @@ set(pybind_module dartpy)
  44. #
  45. pybind11_add_module(${pybind_module}
  46. MODULE
  47. - EXCLUDE_FROM_ALL
  48. ${dartpy_headers}
  49. ${dartpy_sources}
  50. )
  51. @@ -91,9 +85,9 @@ endif()
  52. # TODO: Fix installing dartpy to site-packages directory
  53. # Install the pybind module to site-packages directory
  54. -# install(TARGETS ${pybind_module}
  55. -# LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}"
  56. -# )
  57. +install(TARGETS ${pybind_module}
  58. + LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}"
  59. +)
  60. list(REMOVE_ITEM dartpy_headers
  61. ${CMAKE_CURRENT_LIST_DIR}/eigen_geometry_pybind.h