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

Export the ezc3d target. #116

Merged
merged 3 commits into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${EZC3D_BINARY_DIR}/include"
)
# Include directories when other targets in this project use this library:
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${EZC3D_BINARY_DIR}/include>
)

# Install target
if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion binding/ezc3d.i
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace std {
}
}

// Includes all neceressary files from the API
// Includes all necessary files from the API
%include "ezc3dConfig.h"
%include "ezc3d.h"
%include "Matrix.h"
Expand Down
4 changes: 2 additions & 2 deletions binding/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ foreach(SUFFIXES Read Write)
# Add project
add_library(${PROJECT_NAME}_${SUFFIXES} SHARED ${CPP_FILE_${SUFFIXES}} ${CMAKE_CURRENT_SOURCE_DIR}/Matlabdef.def)

target_link_libraries(${PROJECT_NAME}_${SUFFIXES} ezc3d)

# Reset the name of the output
if(WIN32)
SET_TARGET_PROPERTIES(${PROJECT_NAME}_${SUFFIXES} PROPERTIES OUTPUT_NAME ${MASTER_PROJECT_NAME}${SUFFIXES})
Expand All @@ -25,8 +27,6 @@ foreach(SUFFIXES Read Write)
# Add headers
target_include_directories(${PROJECT_NAME}_${SUFFIXES} PUBLIC
${Matlab_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CUREENT_SOURCE_DIR}/../../include
${EZC3D_BINARY_DIR}/include
)

Expand Down
8 changes: 6 additions & 2 deletions binding/matlab/ezc3dWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ void mexFunction(
} else if (type == ezc3d::DATA_TYPE::FLOAT) {
std::vector<float> data;
parseParam(mxGetDoubles(valueField), dimension, data);
newParam.set(data, dimension);
newParam.set(
std::vector<double>(data.begin(), data.end()),
dimension);
Comment on lines +374 to +376
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! I did not update the Matlab interface yet with the new changes :)

} else if (type == ezc3d::DATA_TYPE::CHAR) {
std::vector<std::string> data;
parseParam(valueField, dimension, data);
Expand All @@ -386,7 +388,9 @@ void mexFunction(
if (!valueField || mxIsDouble(valueField)) {
std::vector<float> data;
parseParam(mxGetDoubles(valueField), dimension, data);
newParam.set(data, dimension);
newParam.set(
std::vector<double>(data.begin(), data.end()),
dimension);
} else if (mxIsCell(valueField)) {
std::vector<std::string> data;
parseParam(valueField, dimension, data);
Expand Down
5 changes: 0 additions & 5 deletions binding/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if(WIN32)
endif()
# For some reasons, target_include_directories later in the file sometime fails
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../../include
${EZC3D_BINARY_DIR}/include
)

Expand All @@ -25,10 +24,6 @@ SWIG_ADD_LIBRARY(${PROJECT_NAME} TYPE MODULE LANGUAGE python SOURCES ${I_SOURCE_
swig_link_libraries(${PROJECT_NAME} ${PROJECT_NAME} ${PYTHON_LIBRARIES} ${NUMPY_LIBRARIES})

# Add headers
target_include_directories(_${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../include
${EZC3D_BINARY_DIR}/include
)
set_target_properties(_${PROJECT_NAME} PROPERTIES SWIG_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

if(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion include/Vector3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// \date March 25th, 2020
///

#include <Matrix.h>
#include "Matrix.h"

///
/// \brief 3D data
Expand Down