Skip to content

Commit 72c895e

Browse files
authored
Merge pull request #76 from seanyen/windows_fix
Initial Windows bring-up
2 parents c7b30f6 + 40f0de1 commit 72c895e

File tree

9 files changed

+39
-18
lines changed

9 files changed

+39
-18
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ SET(${PROJECT_NAME}_HEADERS
109109
INCLUDE_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/include)
110110
INCLUDE_DIRECTORIES(${${PROJECT_NAME}_SOURCE_DIR}/include)
111111

112+
LINK_DIRECTORIES(${PYTHON_LIBRARY_DIRS})
113+
112114
# ----------------------------------------------------
113115
# --- TARGETS ----------------------------------------
114116
# ----------------------------------------------------
@@ -131,11 +133,21 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}${P
131133

132134
TARGET_LINK_BOOST_PYTHON(${PROJECT_NAME})
133135
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} eigen3)
134-
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
136+
INSTALL(TARGETS ${PROJECT_NAME}
137+
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
138+
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
139+
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
135140

136141
ADD_HEADER_GROUP(${PROJECT_NAME}_HEADERS)
137142
ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)
138143

144+
INCLUDE(GenerateExportHeader)
145+
GENERATE_EXPORT_HEADER(${PROJECT_NAME} EXPORT_FILE_NAME eigenpy/${PROJECT_NAME}_export.h)
146+
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
147+
148+
INSTALL(FILES
149+
${CMAKE_CURRENT_BINARY_DIR}/eigenpy/${PROJECT_NAME}_export.h
150+
DESTINATION include/eigenpy)
139151
# ----------------------------------------------------
140152
# --- PYTHON LIBRARY ---------------------------------
141153
# ----------------------------------------------------

include/eigenpy/details.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ namespace eigenpy
300300
// Check if the Scalar type of the obj_ptr is compatible with the Scalar type of MatType
301301
if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) == NPY_INT)
302302
{
303-
if(not FromTypeToType<int,typename MatType::Scalar>::value)
303+
if(!FromTypeToType<int,typename MatType::Scalar>::value)
304304
{
305305
#ifndef NDEBUG
306306
std::cerr << "The Python matrix scalar type (int) cannot be converted into the scalar type of the Eigen matrix. Loss of arithmetic precision" << std::endl;
@@ -310,7 +310,7 @@ namespace eigenpy
310310
}
311311
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) == NPY_LONG)
312312
{
313-
if(not FromTypeToType<long,typename MatType::Scalar>::value)
313+
if(!FromTypeToType<long,typename MatType::Scalar>::value)
314314
{
315315
#ifndef NDEBUG
316316
std::cerr << "The Python matrix scalar type (long) cannot be converted into the scalar type of the Eigen matrix. Loss of arithmetic precision" << std::endl;
@@ -320,7 +320,7 @@ namespace eigenpy
320320
}
321321
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) == NPY_FLOAT)
322322
{
323-
if(not FromTypeToType<float,typename MatType::Scalar>::value)
323+
if(!FromTypeToType<float,typename MatType::Scalar>::value)
324324
{
325325
#ifndef NDEBUG
326326
std::cerr << "The Python matrix scalar type (float) cannot be converted into the scalar type of the Eigen matrix. Loss of arithmetic precision" << std::endl;
@@ -330,7 +330,7 @@ namespace eigenpy
330330
}
331331
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) == NPY_DOUBLE)
332332
{
333-
if(not FromTypeToType<double,typename MatType::Scalar>::value)
333+
if(!FromTypeToType<double,typename MatType::Scalar>::value)
334334
{
335335
#ifndef NDEBUG
336336
std::cerr << "The Python matrix scalar (double) type cannot be converted into the scalar type of the Eigen matrix. Loss of arithmetic precision." << std::endl;

include/eigenpy/eigenpy.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "eigenpy/fwd.hpp"
1010
#include "eigenpy/deprecated.hh"
11+
#include "eigenpy/eigenpy_export.h"
1112
#if EIGEN_VERSION_AT_LEAST(3,2,0)
1213
#include "eigenpy/ref.hpp"
1314

@@ -25,7 +26,7 @@
2526
namespace eigenpy
2627
{
2728
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */
28-
void enableEigenPy();
29+
void EIGENPY_EXPORT enableEigenPy();
2930

3031
template<typename MatType>
3132
void enableEigenPySpecific();

include/eigenpy/expose.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace eigenpy
2727
template<typename T>
2828
inline void expose()
2929
{
30-
if(not register_symbolic_link_to_registered_type<T>())
30+
if(!register_symbolic_link_to_registered_type<T>())
3131
internal::call_expose<T>::run();
3232
}
3333
}

include/eigenpy/geometry.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
#ifndef __eigenpy_geometry_hpp__
77
#define __eigenpy_geometry_hpp__
88

9+
#include "eigenpy/eigenpy_export.h"
10+
911
namespace eigenpy
1012
{
1113

12-
void exposeQuaternion();
13-
void exposeAngleAxis();
14+
void EIGENPY_EXPORT exposeQuaternion();
15+
void EIGENPY_EXPORT exposeAngleAxis();
1416

15-
void exposeGeometryConversion();
17+
void EIGENPY_EXPORT exposeGeometryConversion();
1618

1719
} // namespace eigenpy
1820

include/eigenpy/ref.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111

1212
// For old Eigen versions, EIGEN_DEVICE_FUNC is not defined.
1313
// We must define it just in the scope of this file.
14-
#if not EIGEN_VERSION_AT_LEAST(3,2,90)
14+
#if !EIGEN_VERSION_AT_LEAST(3,2,90)
1515
#define EIGEN_DEVICE_FUNC
1616
#endif
1717

1818
namespace eigenpy
1919
{
2020

21-
template<typename PlainObjectType>
22-
struct Ref : Eigen::Ref<PlainObjectType,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename StrideType<PlainObjectType>::type>
21+
template<typename PlainObjectTypeT>
22+
struct Ref : Eigen::Ref<PlainObjectTypeT,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename StrideType<PlainObjectTypeT>::type>
2323
{
2424
public:
25-
typedef Eigen::Ref<PlainObjectType,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename StrideType<PlainObjectType>::type> Base;
26-
25+
typedef Eigen::Ref<PlainObjectTypeT,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename eigenpy::template StrideType<PlainObjectTypeT>::type> Base;
26+
2727
private:
2828
typedef Eigen::internal::traits<Base> Traits;
2929
template<typename Derived>
@@ -83,7 +83,7 @@ namespace eigenpy
8383
}; // struct Ref<PlainObjectType>
8484
}
8585

86-
#if not EIGEN_VERSION_AT_LEAST(3,2,90)
86+
#if !EIGEN_VERSION_AT_LEAST(3,2,90)
8787
#undef EIGEN_DEVICE_FUNC
8888
#endif
8989

include/eigenpy/solvers/preconditioners.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
#ifndef __eigenpy_preconditioners_hpp__
1818
#define __eigenpy_preconditioners_hpp__
1919

20+
#include "eigenpy/eigenpy_export.h"
21+
2022
namespace eigenpy
2123
{
2224

23-
void exposePreconditioners();
25+
void EIGENPY_EXPORT exposePreconditioners();
2426

2527
} // namespace eigenpy
2628

include/eigenpy/solvers/solvers.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
#ifndef __eigenpy_solvers_hpp__
1818
#define __eigenpy_solvers_hpp__
1919

20+
#include "eigenpy/eigenpy_export.h"
21+
2022
namespace eigenpy
2123
{
2224
struct SolversScope {};
2325

24-
void exposeSolvers();
26+
void EIGENPY_EXPORT exposeSolvers();
2527

2628
} // namespace eigenpy
2729

python/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ SET_PROPERTY(TARGET ${PYWRAP} PROPERTY LINKER_LANGUAGE CXX)
3333
IF(APPLE)
3434
# We need to change the extension for python bindings
3535
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ".so")
36+
ELSEIF(WIN32)
37+
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ".pyd")
3638
ENDIF(APPLE)
3739

3840
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES

0 commit comments

Comments
 (0)