Skip to content
Snippets Groups Projects
Commit 1518e12f authored by t steve's avatar t steve
Browse files

correct library packaging

parent 5cc17c34
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 2.6)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake2/FindqpOASES.cmake)
SET(PROJECT_NAME bezier-com-traj)
SET(PROJECT_DESCRIPTION
......@@ -47,6 +46,8 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF(BUILD_PYTHON_INTERFACE)
find_package (centroidal-dynamics-lib REQUIRED)
# Declare Headers
SET(${PROJECT_NAME}_HEADERS
include/bezier-com-traj/data.hh
......@@ -66,9 +67,6 @@ else()
endif()
#SEARCH_FOR_QPOASES()
ADD_REQUIRED_DEPENDENCY("qpOASES")
add_subdirectory(src)
add_subdirectory(tests)
IF(BUILD_PYTHON_INTERFACE)
......
# - Try to find libcdd
# Once done this will define
# CDL_FOUND - System has CDL
# CDL_INCLUDE_DIRS - The CDL include directories
# CDL_LIBRARIES - The libraries needed to use CDL
# CDL_DEFINITIONS - Compiler switches required for using CDL
find_path(CDL_INCLUDE_DIR centroidal-dynamics-lib/centroidal_dynamics.h
HINTS ${CDL_INCLUDEDIR} /usr/include
PATH_SUFFIXES CDL )
find_library(CDL_LIBRARY NAMES libcentroidal-dynamics-lib.so
HINTS ${CDL_LIBDIR} ${CDL_LIBRARY_DIRS} /usr/lib/libcentroidal-dynamics-lib.so )
set(CDL_LIBRARIES ${CDL_LIBRARY} )
set(CDL_INCLUDE_DIRS ${CDL_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CDL_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(CDL DEFAULT_MSG
CDL_LIBRARY CDL_INCLUDE_DIR)
mark_as_advanced(CDL_INCLUDE_DIR CDL_LIBRARY )
#.rst:
# FindqpOASES
# -----------
#
# Try to find the qpOASES library.
# Once done this will define the following variables::
#
# qpOASES_FOUND - System has qpOASES
# qpOASES_INCLUDE_DIR - qpOASES include directory
# qpOASES_LIBRARY - qpOASES libraries
#
# qpOASES does not have an "install" step, and the includes are in the source
# tree, while the libraries are in the build tree.
# Therefore the environment and cmake variables `qpOASES_SOURCE_DIR` and
# `qpOASES_BINARY_DIR` will be used to locate the includes and libraries.
#=============================================================================
# Copyright 2014 iCub Facility, Istituto Italiano di Tecnologia
# Authors: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of YCM, substitute the full
# License text for the above reference.)
MACRO(SEARCH_FOR_QPOASES)
include(FindPackageHandleStandardArgs)
find_path(qpOASES_INCLUDEDIR
NAMES qpOASES.hpp
HINTS "${qpOASES_SOURCE_DIR}"
ENV qpOASES_SOURCE_DIR
PATH_SUFFIXES include)
find_library(qpOASES_LIB
NAMES qpOASES
HINTS "${qpOASES_BINARY_DIR}"
ENV qpOASES_BINARY_DIR
PATH_SUFFIXES lib
libs)
set(qpOASES_INCLUDE_DIR ${qpOASES_INCLUDEDIR})
set(qpOASES_LIBRARY ${qpOASES_LIB})
find_package_handle_standard_args(qpOASES DEFAULT_MSG qpOASES_LIBRARY
qpOASES_INCLUDE_DIR)
set(qpOASES_FOUND ${QPOASES_FOUND})
ENDMACRO(SEARCH_FOR_QPOASES)
......@@ -4,33 +4,21 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
include_directories("${INCLUDE_DIR}")
include_directories("${EIGEN3_INCLUDE_DIR}")
# no need to include directories for qpOASES as it is automatically done through pkgconfig
SET(LIBRARY_NAME ${PROJECT_NAME})
SET(${LIBRARY_NAME}_SOURCES
${INCLUDE_DIR}/bezier-com-traj/config.hh
${INCLUDE_DIR}/bezier-com-traj/data.hh
${INCLUDE_DIR}/bezier-com-traj/solve.hh
${INCLUDE_DIR}/bezier-com-traj/common_solve_methods.hh
${INCLUDE_DIR}/solver/eiquadprog-fast.hpp
solve.cpp
common_solve_methods.cpp
eiquadprog-fast.cpp
solve_transition.cpp
#~ ${INCLUDE_DIR}/centroidal-dynamics-lib/solver_LP_abstract.hh
#~ ${INCLUDE_DIR}/centroidal-dynamics-lib/solver_LP_qpoases.hh
#~ ${INCLUDE_DIR}/centroidal-dynamics-lib/solver_LP_clp.hh
#~ ${INCLUDE_DIR}/centroidal-dynamics-lib/centroidal_dynamics.hh
#~ centroidal_dynamics.cpp
#~ solver_LP_abstract.cpp
#~ solver_LP_qpoases.cpp
#~ solver_LP_clp.cpp
#~ util.cpp
#~ logger.cpp
#~ stop-watch.cpp
)
${INCLUDE_DIR}/bezier-com-traj/config.hh
${INCLUDE_DIR}/bezier-com-traj/data.hh
${INCLUDE_DIR}/bezier-com-traj/solve.hh
${INCLUDE_DIR}/bezier-com-traj/common_solve_methods.hh
${INCLUDE_DIR}/solver/eiquadprog-fast.hpp
solve.cpp
common_solve_methods.cpp
eiquadprog-fast.cpp
solve_transition.cpp
)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES})
......@@ -38,9 +26,7 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES})
if ( MSVC )
SET(CMAKE_DEBUG_POSTFIX d)
endif ( MSVC )
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} centroidal-dynamics-lib)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} qpOASES)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CDL_LIBRARIES})
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
......
......@@ -25,11 +25,9 @@ MACRO(ADD_TESTCASE NAME GENERATED)
ENDIF()
ADD_TEST(${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${NAME})
PKG_CONFIG_USE_DEPENDENCY(${NAME} qpOASES)
# Link against Boost and project library.
TARGET_LINK_LIBRARIES(${NAME}
${Boost_LIBRARIES} centroidal-dynamics-lib bezier-com-traj
${Boost_LIBRARIES} bezier-com-traj ${CDL_LIBRARIES}
)
ENDMACRO(ADD_TESTCASE)
......@@ -37,14 +35,12 @@ ENDMACRO(ADD_TESTCASE)
ADD_TESTCASE (test-transition-quasiStatic False)
ADD_TESTCASE (test-transition False)
if ( MSVC )
SET(CMAKE_DEBUG_POSTFIX d)
endif ( MSVC )
ADD_EXECUTABLE(bezier-com-traj-test test_static_equilibrium.cpp)
ADD_EXECUTABLE(bezier-com-traj-test test_static_equilibrium.cpp test_helper.hh)
TARGET_LINK_LIBRARIES(bezier-com-traj-test bezier-com-traj)
TARGET_LINK_LIBRARIES(bezier-com-traj-test bezier-com-traj ${CDL_LIBRARIES})
......@@ -4,6 +4,7 @@
#include <bezier-com-traj/solve.hh>
#include <bezier-com-traj/common_solve_methods.hh>
#include <centroidal-dynamics-lib/centroidal_dynamics.hh>
#include <boost/test/included/unit_test.hpp>
using bezier_com_traj::MatrixXX;
using bezier_com_traj::MatrixX3;
......
......@@ -25,6 +25,8 @@ using namespace std;
#define EPS 1e-3 // required precision
void generateContacts(unsigned int N_CONTACTS, double MIN_CONTACT_DISTANCE, double LX, double LY,
RVector3 &CONTACT_POINT_LOWER_BOUNDS,
RVector3 &CONTACT_POINT_UPPER_BOUNDS,
......
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