Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature ezc3d #2728

Merged
merged 21 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a788fea
Started to add ezc3d into the CMakeLists' BTK still works just fine, …
pariterre Mar 26, 2020
fb96c32
Added the read of event when using ezc3d
pariterre Mar 26, 2020
2432d35
Included markers from ezc3d
pariterre Mar 26, 2020
95714d5
Answered change requests from PR
pariterre Mar 27, 2020
a77b0b7
Answered other comments from the review
pariterre Mar 29, 2020
30afa25
Added the force plates using EZC3D
pariterre Mar 29, 2020
8c35a8e
Bumped the ezc3d version
pariterre Mar 29, 2020
511c56d
Use ezc3d's exported target.
chrisdembia Mar 29, 2020
8830a5f
Used OPENSIM_THROW for throwing
pariterre Mar 29, 2020
d1775c8
Merge pull request #2 from opensim-org/ConnectEzc3d_cmake
pariterre Mar 29, 2020
5721415
Bumped ezc3d to last release (1.3.0)
pariterre Mar 30, 2020
25c69c6
Reorganize C3D extendRead().
chrisdembia Apr 2, 2020
41b2824
Allow testC3DFileAdapter to take longer to run.
chrisdembia Apr 2, 2020
f23117c
Merge pull request #3 from opensim-org/ConnectEzc3d_reorg
pariterre Apr 3, 2020
d8bfd53
Added comment on an #else
pariterre Apr 3, 2020
87ed47f
Bumped to ezc3d 1.3.1 which validated Type4 force plate
pariterre Apr 4, 2020
ee9b696
Bumped to a slightly faster Ezc3d version
pariterre Apr 5, 2020
bef4b50
Support ezc3d on Windows.
chrisdembia Apr 9, 2020
9ba9610
Merge pull request #4 from opensim-org/ConnectEzc3d_cmakewin
pariterre Apr 9, 2020
f1bc7b1
Merge pull request #2695 from pariterre/ConnectEzc3d
chrisdembia Apr 11, 2020
65f7020
Disable timing test with ezc3d. (#2727)
chrisdembia Apr 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif()
if(WITH_BTK)
set(SWIG_FLAGS "-DWITH_BTK")
endif()
if(WITH_EZC3D)
set(SWIG_FLAGS "-DWITH_EZC3D")
endif()

if(BUILD_PYTHON_WRAPPING)
add_subdirectory(Python)
Expand Down
79 changes: 60 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ from the internet, we turn this option OFF." ON)
set(SIMBODY_HOME $ENV{SIMBODY_HOME} CACHE
PATH "The location of the Simbody installation to use; you can change this. Set as empty to let CMake search for Simbody automatically.")

option(OPENSIM_COPY_DEPENDENCIES "Copy Simbody and BTK into the
option(OPENSIM_COPY_DEPENDENCIES "Copy Simbody, ezc3d and BTK into the
OpenSim installation. This should be set to ON when making a relocatable
distribution, and should be set to OFF when packaging for Homebrew, Debian,
etc. On Linux and macOS: we use relative RPATHs when ON, and absolute RPATHs
Expand All @@ -94,7 +94,7 @@ BUILD_PYTHON_WRAPPING is ON, so if this OFF, a warning is thrown." ON)
mark_as_advanced(OPENSIM_COPY_DEPENDENCIES)

option(OPENSIM_PYTHON_STANDALONE "Make the Python package standalone, meaning
the OpenSim (and Simbody and BTK) shared libraries it depends on are copied
the OpenSim (and Simbody, ezc3d and BTK) shared libraries it depends on are copied
into the package. If you are building OpenSim on the same machine on which you
plan to use it, you can leave this OFF. If you are distributing OpenSim to
other computers, you should turn this ON. If macOS, this option affects how
Expand Down Expand Up @@ -561,9 +561,9 @@ if(UNIX) # Linux and macOS
# Add the automatically determined parts of the RPATH which point
# to directories outside the build tree to the install RPATH.
# If we are copying Simbody into OpenSim's installation, then
# there's no need to link to the libraries in Simbody's or BTK's
# there's no need to link to the libraries in Simbody's, ezc3d's or BTK's
# original installations. Furthermore, we may be distributing OpenSim
# to other computers that will not have our original Simbody or BTK
# to other computers that will not have our original Simbody, ezc3d or BTK
# installations, and so the RPATH would point to a nonexistant
# directory on others' computers.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand All @@ -585,15 +585,41 @@ set(OPENSIM_DEPENDENCIES_DIR
"Directory containing installed binaries of OpenSim dependencies. Set this
only if you used the Superbuild procedure to install dependencies. ")

set(WITH_BTK
OFF
CACHE
BOOL
"Compile OpenSim with BTK ? BTK provides C3D reading.")
set(OPENSIM_C3D_PARSER None CACHE STRING
"Compile OpenSim with a C3D parser ? ezc3d or BTK provide C3D reading.")
set_property(CACHE OPENSIM_C3D_PARSER PROPERTY STRINGS "ezc3d" "BTK" "None")
if(${OPENSIM_C3D_PARSER} STREQUAL "ezc3d")
set(WITH_EZC3D true)
set(WITH_BTK false)
if(WIN32)
set(ezc3d_hint "${OPENSIM_DEPENDENCIES_DIR}/ezc3d/lib/cmake")
else()
set(ezc3d_hint "${OPENSIM_DEPENDENCIES_DIR}/ezc3d/lib/ezc3d/cmake")
endif()
find_package(ezc3d REQUIRED HINTS "${ezc3d_hint}")
add_definitions(-DWITH_EZC3D)
OpenSimCopyDependencyDLLsForWin(ezc3d "${ezc3d_LIBRARY_DIR}/../")
if(BUILD_PYTHON_WRAPPING AND OPENSIM_PYTHON_STANDALONE)
OpenSimInstallDependencyLibraries(ezc3d "${ezc3d_LIBRARY_DIR}/../"
"${ezc3d_LIBRARY_DIR}" "${OPENSIM_INSTALL_PYTHONDIR}/opensim")
endif()

if(NOT WIN32)
# LIB: .so files on Linux, .dylib on macOS
file(GLOB ezc3d_desired_lib_files "${ezc3d_LIBRARY_DIR}/*ezc3d*")
install(FILES ${ezc3d_desired_lib_files}
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

elseif(${OPENSIM_C3D_PARSER} STREQUAL "BTK")
set(WITH_EZC3D false)
unset(ezc3d_LIBRARY_DIR CACHE)
unset(ezc3d_LIBRARY)
unset(ezc3d_INCLUDE_DIR CACHE)
set(WITH_BTK true)

# If compiling with BTK, find and use it.
if(WITH_BTK)
find_package(BTK
# If compiling with BTK, find and use it.
find_package(BTK
REQUIRED
HINTS "${OPENSIM_DEPENDENCIES_DIR}/BTK/share/btk-0.4dev")
include(${BTK_USE_FILE})
Expand All @@ -603,6 +629,19 @@ if(WITH_BTK)
OpenSimInstallDependencyLibraries(BTK "${BTK_INSTALL_PREFIX}"
"${BTK_LIBRARY_DIRS}" "${OPENSIM_INSTALL_PYTHONDIR}/opensim")
endif()

if(NOT WIN32)
# LIB: .so files on Linux, .dylib on macOS
file(GLOB btk_desired_lib_files "${BTK_LIBRARY_DIRS}/*BTK*")
install(FILES ${btk_desired_lib_files}
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()
else()
set(WITH_EZC3D false)
unset(ezc3d_LIBRARY_DIR CACHE)
unset(ezc3d_LIBRARY)
unset(ezc3d_INCLUDE_DIR CACHE)
set(WITH_BTK false)
endif()

if(NOT SIMBODY_HOME AND OPENSIM_DEPENDENCIES_DIR)
Expand Down Expand Up @@ -754,16 +793,18 @@ if(${OPENSIM_COPY_DEPENDENCIES})
FILES_MATCHING PATTERN "*simbody-visualizer*")
endif()

# EZC3D
# -----
if(NOT WIN32)
# LIB: .so files on Linux, .dylib on macOS
file(GLOB ezc3d_desired_lib_files "${ezc3d_LIBRARY_DIR}/*ezc3d*")
install(FILES ${ezc3d_desired_lib_files}
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

# BTK
# ---
if(WIN32)
file(GLOB btk_desired_dll_files "${BTK_INSTALL_DIR}/*BTK*.dll")
install(FILES ${btk_desired_dll_files}
DESTINATION "${CMAKE_INSTALL_BINDIR}")
# No need to copy *.lib on Windows, as BTK links "privately" to
# osimCommon (clients of osimCommon do not link to BTK).
else()
if(NOT WIN32)
# LIB: .so files on Linux, .dylib on macOS
file(GLOB btk_desired_lib_files "${BTK_LIBRARY_DIRS}/*BTK*")
install(FILES ${btk_desired_lib_files}
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Common/Adapters.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "STOFileAdapter.h"
#include "CSVFileAdapter.h"

#ifdef WITH_BTK
#if defined (WITH_EZC3D) || defined (WITH_BTK)

#include "C3DFileAdapter.h"

Expand Down