Skip to content

Commit

Permalink
Merge branch 'dev_pyo' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Feb 28, 2019
2 parents 6e5c810 + e71b5cf commit ae1c8f3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
11 changes: 9 additions & 2 deletions binding/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ set_property(SOURCE ${I_SOURCE_FILE} PROPERTY CPLUSPLUS ON)
SWIG_ADD_LIBRARY(${PROJECT_NAME} TYPE MODULE LANGUAGE python SOURCES ${I_SOURCE_FILE})
swig_link_libraries(${PROJECT_NAME} ${PROJECT_NAME} ${PYTHON_LIBRARIES} ${NUMPY_LIBRARIES})

SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER})
SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES SUFFIX ".so" INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER})
SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET _${PROJECT_NAME} APPEND PROPERTY LINK_FLAGS "-flat_namespace -undefined suppress")
else()
SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER})
SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()


# Install to the proper directories
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py
Expand Down
8 changes: 5 additions & 3 deletions binding/python3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ def write(self, path):
raise ValueError("Number of frames in the data set must match the analog rate X point frame")

nb_analog_subframes = int(nb_analog_frames / nb_point_frames)
self._storage['parameters']['ANALOG']['RATE']['value'][0] = nb_analog_subframes * \
self._storage['parameters']['POINT']['RATE']['value'][0]
self._storage['parameters']['ANALOG']['RATE']['value'] = (
nb_analog_subframes
* self._storage['parameters']['POINT']['RATE']['value'][0],
)
nb_frames = nb_point_frames
else:
nb_frames = nb_analog_frames
Expand All @@ -187,7 +189,7 @@ def write(self, path):
# Fill the parameters
groups = self._storage['parameters']

# Update some important stuff (names of markers and analogs)
# Update some important stuff (names of points and analogs)
point_labels = groups['POINT']['LABELS']['value']
for point_label in point_labels:
new_c3d.point(point_label)
Expand Down
8 changes: 6 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
else()
SET(${MASTER_PROJECT_NAME}_LIB_NAME ${MASTER_PROJECT_NAME})
endif()
if (UNIX)
if (APPLE)
string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".dylib")
elseif(UNIX)
string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".so")
elseif(WIN32)
message("Compilation won't work on Windows, to be corrected later...")
message("Compilation won't work on Windows, to be corrected later...")
string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME ${${MASTER_PROJECT_NAME}_LIB_NAME} ".dll")
else()
message(FATAL_ERROR "Unrecognized system")
endif()
set(${MASTER_PROJECT_NAME}_LIBRARY ${CMAKE_BINARY_DIR}/${${MASTER_PROJECT_NAME}_LIB_NAME})
target_link_libraries(${PROJECT_NAME} ${${MASTER_PROJECT_NAME}_LIBRARY})
Expand Down

0 comments on commit ae1c8f3

Please sign in to comment.