Skip to content

Commit

Permalink
Set version
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Mar 15, 2024
1 parent 970687a commit 3f95dbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions python/dartpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ if(TARGET dart-collision-ode)
target_link_libraries(${pybind_module} PUBLIC dart-collision-ode)
endif()

target_compile_definitions(${_ARG_TARGET_NAME}
PRIVATE DARTPY_VERSION_INFO="${DARTPY_VERSION_INFO}"
)

# Remove debug postfix for dartpy
set_target_properties(${pybind_module} PROPERTIES DEBUG_POSTFIX "")

Expand Down
6 changes: 6 additions & 0 deletions python/dartpy/dartpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ PYBIND11_MODULE(dartpy, m)
{
m.doc() = "dartpy: Python API of Dynamic Animation and Robotics Toolkit";

#ifdef DARTPY_VERSION_INFO
m.attr("__version__") = DARTPY_VERSION_INFO;
#else
m.attr("__version__") = "dev";
#endif

eigen_geometry(m);

dart_common(m);
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ def build_extension(self, ext: CMakeExtension) -> None:
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
f"-DBUILD_SHARED_LIBS=OFF",
f"-DDART_DBUILD_TESTING=OFF",
f"-DDART_ENABLE_SIMD=OFF",
f"-DDART_BUILD_WHEELS=ON",
f"-DDART_DOWNLOAD_DEPENDENT_PACKAGES=ON",
f"-DDART_TREAT_WARNINGS_AS_ERRORS=OFF",
]
build_args = []
Expand Down

0 comments on commit 3f95dbf

Please sign in to comment.