Skip to content
Snippets Groups Projects
Commit 652a41fa authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] clean: keep minimal required instructions

parent c506e2ef
No related branches found
No related tags found
No related merge requests found
......@@ -5,48 +5,81 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAMESPACE stack-of-tasks)
SET(PROJECT_NAME sot-tools)
SET(PROJECT_DESCRIPTION "Miscellanous entities for the stack of tasks")
SET(PROJECT_URL "http://github.com/${PROJECT_NAMESPACE}/${PROJECT_NAME}")
OPTION(BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
OPTION(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)
OPTION(SUFFIX_SO_VERSION "Suffix shared library name by a string depending on git status of project" ON)
# Project properties
SET(PROJECT_ORG stack-of-tasks)
SET(PROJECT_NAME sot-tools)
SET(PROJECT_DESCRIPTION "Miscellanous entities for the stack of tasks")
SET(PROJECT_URL "http://github.com/stack-of-tasks/sot-tools")
# Export CMake Target
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/eigen.cmake)
# Project options
OPTION(BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
OPTION(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python bindings" OFF)
OPTION(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
SET(DOXYGEN_USE_MATHJAX YES)
# Project configuration
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES)
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake)
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
# Trigger dependency to dynamic-graph-python
ADD_PROJECT_DEPENDENCY(sot-core 4.8.1 REQUIRED PKG_CONFIG_REQUIRES "sot-core >= 4.8.1")
# Project dependencies
ADD_PROJECT_DEPENDENCY(sot-core REQUIRED PKG_CONFIG_REQUIRES sot-core)
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON ()
FIND_NUMPY ()
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED PKG_CONFIG_REQUIRES "dynamic-graph-python")
FINDPYTHON()
FIND_NUMPY()
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED
PKG_CONFIG_REQUIRES dynamic-graph-python)
ENDIF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY(include/sot/tools)
# Main Library
SET(${PROJECT_NAME}_HEADERS
include/sot/tools/cubic-interpolation.hh
include/sot/tools/cubic-interpolation-se3.hh
include/sot/tools/kinematic-planner.hh
include/sot/tools/seqplay.hh
include/sot/tools/simpleseqplay.hh
)
SET(${PROJECT_NAME}_SOURCES
src/cubic-interpolation.cc
#src/kinematic-planner.cc
src/cubic-interpolation-se3.cc
src/oscillator.cc
src/seqplay.cc
src/simpleseqplay.cc
)
# Verbosity level
IF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
ENDIF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_LIBRARY(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} sot-core::sot-core)
IF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF(SUFFIX_SO_VERSION)
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
Subproject commit fc83d96bdc3d456f965a8f2f14154f55833021a1
Subproject commit 321eb1ccf1d94570eb564f3659b13ef3ef82239e
SET(${PROJECT_NAME}_HEADERS
cubic-interpolation.hh
cubic-interpolation-se3.hh
kinematic-planner.hh
seqplay.hh
simpleseqplay.hh)
INSTALL(FILES ${${PROJECT_NAME}_HEADERS} DESTINATION include/sot/core)
# Copyright 2012, CNRS
# Copyright 2012, 2020, CNRS
# Author: Florent Lamiraux
# Author: Guilhem Saurel
#
SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY(${LIBRARY_NAME} SHARED
cubic-interpolation.cc
#kinematic-planner.cc
cubic-interpolation-se3.cc
oscillator.cc
seqplay.cc
simpleseqplay.cc
)
TARGET_LINK_LIBRARIES (${LIBRARY_NAME} sot-core::sot-core)
DYNAMIC_GRAPH_PYTHON_MODULE ("sot/tools" ${LIBRARY_NAME} wrap)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
INSTALL (TARGETS ${LIBRARY_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
IF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
SOVERSION ${PROJECT_VERSION})
ENDIF()
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${LIBRARY_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
IF(BUILD_PYTHON_INTERFACE)
DYNAMIC_GRAPH_PYTHON_MODULE("sot/tools" ${LIBRARY_NAME} wrap)
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/tools/se3.py
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/tools/quaternion.py
DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/tools
SET(NO_INSTALL_OF_INIT_PY 0)
DYNAMIC_GRAPH_PYTHON_MODULE("sot/tools" ${PROJECT_NAME} wrap
${NO_INSTALL_OF_INIT_PY})
SET(${PROJECT_NAME}_PYTHON
__init__.py
se3.py
quaternion.py
)
FOREACH(py_file ${${PY_NAME}_PYTHON})
PYTHON_INSTALL_ON_SITE("dynamic_graph/sot/toolss" ${py_file})
ENDFOREACH(py_file ${${PY_NAME}_PYTHON})
ENDIF(BUILD_PYTHON_INTERFACE)
File moved
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
ADD_EXECUTABLE(test_simpleseqplay test_simpleseqplay.cc)
TARGET_LINK_LIBRARIES(test_simpleseqplay sot-core::sot-core)
TARGET_LINK_LIBRARIES(test_simpleseqplay sot-tools)
TARGET_LINK_LIBRARIES(test_simpleseqplay
${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARIES})
ADD_TEST(test_simpleseqplay test_simpleseqplay)
ADD_UNIT_TEST(test_simpleseqplay test_simpleseqplay.cc)
TARGET_LINK_LIBRARIES(test_simpleseqplay ${PROJECT_NAME} ${Boost_LIBRARIES}
sot-core::sot-core)
File moved
......@@ -5,26 +5,21 @@
#include "simpleseqplay.hh"
namespace dg = dynamicgraph;
BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE(test_simpleseqplay)
{
BOOST_AUTO_TEST_CASE(test_simpleseqplay) {
dg::sot::tools::SimpleSeqPlay aSimpleSeqPlay("simpleseqplay");
aSimpleSeqPlay.load("test");
aSimpleSeqPlay.start();
for(int i=0;i<1000;i++)
{
dg::Vector pos;
pos = aSimpleSeqPlay.postureSOUT_(i);
if (i==100)
aSimpleSeqPlay.hold();
for (int i = 0; i < 1000; i++) {
dg::Vector pos;
if (i==300)
aSimpleSeqPlay.unhold();
}
pos = aSimpleSeqPlay.postureSOUT_(i);
if (i == 100) aSimpleSeqPlay.hold();
if (i == 300) aSimpleSeqPlay.unhold();
}
}
BOOST_AUTO_TEST_SUITE_END ()
BOOST_AUTO_TEST_SUITE_END()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment