Commit 24ecf178 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

Merge branch 'devel' into 'devel'

[CMake] Packaging

See merge request !2
parents ace8d662 bfa584fa
#
# Copyright (c) 2019 CNRS
#
# This file is part of eiquadprog
# pinocchio is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
# pinocchio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# pinocchio If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
......@@ -21,9 +9,10 @@ INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/eigen.cmake)
INCLUDE(cmake/test.cmake)
SET(PROJECT_NAMESPACE stack-of-tasks)
SET(PROJECT_NAME eiquadprog)
SET(PROJECT_DESCRIPTION "C++ reimplementation of eiquadprog")
SET(PROJECT_URL "https://gepgitlab.laas.fr/gbuondon/eiquadprog")
SET(PROJECT_URL "https://gepgitlab.laas.fr/${PROJECT_NAMESPACE}/${PROJECT_NAME}")
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
# Disable -Werror on Unix for now.
......@@ -37,35 +26,14 @@ SETUP_PROJECT()
# ----------------------------------------------------
ADD_REQUIRED_DEPENDENCY("eigen3")
# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------
# Add headers here if any
SET(${PROJECT_NAME}_HEADERS
include/eiquadprog/eiquadprog.hpp
include/eiquadprog/eiquadprog-fast.hpp
include/eiquadprog/eiquadprog-fast.hxx
)
INSTALL(FILES
${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
)
SET(BOOST_REQUIERED_COMPONENTS "")
SET(BOOST_BUILD_COMPONENTS unit_test_framework)
SET(BOOST_OPTIONAL_COMPONENTS "")
SET(BOOST_COMPONENTS ${BOOST_REQUIERED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
SET(BOOST_COMPONENTS unit_test_framework)
SEARCH_FOR_BOOST()
# Path to boost headers
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
# --- PACKAGING ----------------------------------------------------------------
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
ADD_SUBDIRECTORY(include/${PROJECT_NAME})
ADD_SUBDIRECTORY(unittest)
SETUP_PROJECT_FINALIZE()
SET(${PROJECT_NAME}_HEADERS
eiquadprog.hpp
eiquadprog-fast.hpp
eiquadprog-fast.hxx
)
INSTALL(FILES
${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
)
//
// Copyright (c) 2017 CNRS
//
// This file is part of eiquadprog
// eiquadprog is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
// eiquadprog is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// eiquadprog If not, see
// <http://www.gnu.org/licenses/>.
//
#ifndef EIQUADPROGFAST_HPP_
#define EIQUADPROGFAST_HPP_
......
//
// Copyright (c) 2017 CNRS
//
// This file is part of eiquadprog
// eiquadprog is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
// eiquadprog is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// eiquadprog If not, see
// <http://www.gnu.org/licenses/>.
//
#ifndef EIQUADPROGFAST_HXX_
#define EIQUADPROGFAST_HXX_
......
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
#test paths and names (without .cpp extension)
SET (TESTS
......@@ -5,29 +6,8 @@ SET (TESTS
eiquadprog-fast
)
# --- MACROS ------------------------------------------------------------------
MACRO(ADD_TEST_CFLAGS target flag)
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
MACRO(ADD_EIQUADPROG_UNIT_TEST NAME)
SET(TEST_NAME "${NAME}-test")
ADD_UNIT_TEST(${TEST_NAME} ${NAME}.cpp)
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_INCLUDE_DIRECTORIES(${TEST_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_DYN_LINK")
SET(MODULE_NAME "${NAME}Test")
STRING(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME})
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} eigen3)
# TARGET_LINK_LIBRARIES(${TEST_NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
ENDMACRO(ADD_EIQUADPROG_UNIT_TEST)
FOREACH(TEST ${TESTS})
ADD_EIQUADPROG_UNIT_TEST(${TEST})
ENDFOREACH(TEST)
FOREACH(test ${TESTS})
ADD_UNIT_TEST(${test} ${test})
TARGET_LINK_LIBRARIES(${test} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
PKG_CONFIG_USE_DEPENDENCY(${test} eigen3)
ENDFOREACH(test ${TESTS})
......@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE ( test_full )
Eigen::VectorXi activeSet(2);
size_t activeSetSize;
Eigen::VectorXd solution(1);
Eigen::VectorXd solution(2);
solution(0) = 2.;
solution(1) = 3.;
......
......@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE ( test_full )
Eigen::VectorXd x(2);
Eigen::VectorXd solution(1);
Eigen::VectorXd solution(2);
solution(0) = 2.;
solution(1) = 3.;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment