Skip to content

Commit

Permalink
Merge pull request #10 from pariterre/master
Browse files Browse the repository at this point in the history
Compiling on Mac
  • Loading branch information
pariterre authored Apr 10, 2020
2 parents 1d62121 + fcffaac commit bfd7f07
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,6 @@ OPTION (RBDL_BUILD_PYTHON_WRAPPER "Build experimental python wrapper" OFF)
OPTION (RBDL_BUILD_ADDON_GEOMETRY "Build the geometry library" OFF)
OPTION (RBDL_BUILD_ADDON_MUSCLE "Build the muscle library" OFF)

# Make sure only one math library is selected priorizing the following order: Casadi, Eigen, Simple
IF (RBDL_USE_CASADI_MATH)
IF(RBDL_USE_SIMPLE_MATH)
MESSAGE (WARNING "You can not use both Casadi and Simple math. Automatically choosing RBDL_USE_CASADI_MATH.")
SET (RBDL_USE_SIMPLE_MATH OFF)
ENDIF(RBDL_USE_SIMPLE_MATH)

IF (RBDL_USE_EIGEN3_MATH)
MESSAGE (WARNING "You can not use both Casadi and Eigen3 math. Automatically choosing RBDL_USE_CASADI_MATH.")
SET (RBDL_USE_EIGEN3_MATH OFF)
ENDIF(RBDL_USE_EIGEN3_MATH)
ENDIF(RBDL_USE_CASADI_MATH)

IF (RBDL_USE_EIGEN3_MATH)
IF(RBDL_USE_SIMPLE_MATH)
MESSAGE (WARNING "You can not use both Eigen and Simple math. Automatically choosing RBDL_USE_EIGEN3_MATH.")
SET (RBDL_USE_SIMPLE_MATH OFF)
ENDIF(RBDL_USE_SIMPLE_MATH)
ENDIF (RBDL_USE_EIGEN3_MATH)

IF (NOT RBDL_USE_CASADI_MATH AND NOT RBDL_USE_EIGEN3_MATH AND NOT RBDL_USE_SIMPLE_MATH)
MESSAGE (WARNING "You have to choose exactly one library. Automatically choosing RBDL_USE_EIGEN3_MATH.")
SET(RBDL_USE_EIGEN3_MATH ON)
ENDIF (NOT RBDL_USE_CASADI_MATH AND NOT RBDL_USE_EIGEN3_MATH AND NOT RBDL_USE_SIMPLE_MATH)

# Loading the appropriate packages
IF (RBDL_USE_CASADI_MATH)
FIND_PACKAGE (Casadi REQUIRED)
Expand Down Expand Up @@ -175,6 +150,11 @@ IF (RBDL_BUILD_STATIC)
rbdl_luamodel-static
)
ENDIF (RBDL_BUILD_ADDON_LUAMODEL)
IF (RBDL_USE_CASADI_MATH)
TARGET_LINK_LIBRARIES ( rbdl-static
${Casadi_LIBRARY}
)
ENDIF (RBDL_USE_CASADI_MATH)

INSTALL (TARGETS rbdl-static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -191,6 +171,11 @@ ELSE (RBDL_BUILD_STATIC)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
IF (RBDL_USE_CASADI_MATH)
TARGET_LINK_LIBRARIES ( rbdl
${Casadi_LIBRARY}
)
ENDIF (RBDL_USE_CASADI_MATH)
ENDIF (RBDL_BUILD_STATIC)

IF (RBDL_STORE_VERSION)
Expand Down

0 comments on commit bfd7f07

Please sign in to comment.