diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 936bf4f9..22e7a2d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,22 @@ + +find_package(SISL) + +set(sisl_hpp "") +set(sisl_cpp "") + +#compile without Spline and Trajectory if SISL is not found +if(SISL_FOUND) + set(sisl_hpp Spline.hpp + Trajectory.hpp) + set(sisl_cpp Spline.cpp + Trajectory.cpp) + include_directories(${SISL_INCLUDE_DIRS}) +else() + message(WARNING "SISL not found. Compiling without spline and trajectory support!") +endif() + rock_library( - base-types + base-types Angle.cpp JointLimitRange.cpp JointLimits.cpp @@ -8,12 +25,11 @@ rock_library( JointTransform.cpp Pose.cpp Pressure.cpp - Spline.cpp + ${sisl_cpp} Temperature.cpp Time.cpp TimeMark.cpp Timeout.cpp - Trajectory.cpp TransformWithCovariance.cpp TwistWithCovariance.cpp Waypoint.cpp @@ -48,13 +64,12 @@ rock_library( Point.hpp Pose.hpp Pressure.hpp - Singleton.hpp - Spline.hpp + Singleton.hpp Temperature.hpp Time.hpp + ${sisl_hpp} TimeMark.hpp Timeout.hpp - Trajectory.hpp TransformWithCovariance.hpp TwistWithCovariance.hpp Waypoint.hpp @@ -63,7 +78,7 @@ rock_library( commands/Motion2D.hpp commands/Speed6D.hpp commands/LinearAngular6DCommand.hpp - logging/logging_iostream_style.h + logging/logging_iostream_style.h logging/logging_printf_style.h samples/BodyState.hpp samples/CommandSamples.hpp @@ -84,15 +99,17 @@ rock_library( samples/Wrench.hpp samples/Wrenches.hpp templates/TimeStamped.hpp - DEPS_CMAKE - SISL - DEPS_PKGCONFIG + DEPS_PKGCONFIG base-logging eigen3 ) -install(FILES ${CMAKE_SOURCE_DIR}/src/Spline.hpp - DESTINATION include/base/geometry) +if(SISL_FOUND) + target_link_libraries(base-types ${SISL_LIBRARIES}) + + install(FILES ${CMAKE_SOURCE_DIR}/src/Spline.hpp + DESTINATION include/base/geometry) +endif() configure_file(base-lib.pc.in ${CMAKE_BINARY_DIR}/base-lib.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/base-lib.pc DESTINATION lib/pkgconfig)