Skip to content

Commit 24ecf17

Browse files
committed
Merge branch 'devel' into 'devel'
[CMake] Packaging See merge request stack-of-tasks/eiquadprog!2
2 parents ace8d66 + bfa584f commit 24ecf17

File tree

7 files changed

+27
-95
lines changed

7 files changed

+27
-95
lines changed

CMakeLists.txt

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
#
22
# Copyright (c) 2019 CNRS
33
#
4-
# This file is part of eiquadprog
5-
# pinocchio is free software: you can redistribute it
6-
# and/or modify it under the terms of the GNU Lesser General Public
7-
# License as published by the Free Software Foundation, either version
8-
# 3 of the License, or (at your option) any later version.
9-
# pinocchio is distributed in the hope that it will be
10-
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11-
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12-
# General Lesser Public License for more details. You should have
13-
# received a copy of the GNU Lesser General Public License along with
14-
# pinocchio If not, see
15-
# <http://www.gnu.org/licenses/>.
164

175
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
186

@@ -21,9 +9,10 @@ INCLUDE(cmake/boost.cmake)
219
INCLUDE(cmake/eigen.cmake)
2210
INCLUDE(cmake/test.cmake)
2311

12+
SET(PROJECT_NAMESPACE stack-of-tasks)
2413
SET(PROJECT_NAME eiquadprog)
2514
SET(PROJECT_DESCRIPTION "C++ reimplementation of eiquadprog")
26-
SET(PROJECT_URL "https://gepgitlab.laas.fr/gbuondon/eiquadprog")
15+
SET(PROJECT_URL "https://gepgitlab.laas.fr/${PROJECT_NAMESPACE}/${PROJECT_NAME}")
2716
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
2817

2918
# Disable -Werror on Unix for now.
@@ -37,35 +26,14 @@ SETUP_PROJECT()
3726
# ----------------------------------------------------
3827
ADD_REQUIRED_DEPENDENCY("eigen3")
3928

40-
# ----------------------------------------------------
41-
# --- INCLUDE ----------------------------------------
42-
# ----------------------------------------------------
43-
# Add headers here if any
44-
SET(${PROJECT_NAME}_HEADERS
45-
include/eiquadprog/eiquadprog.hpp
46-
include/eiquadprog/eiquadprog-fast.hpp
47-
include/eiquadprog/eiquadprog-fast.hxx
48-
)
49-
50-
INSTALL(FILES
51-
${${PROJECT_NAME}_HEADERS}
52-
DESTINATION include/${PROJECT_NAME}
53-
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
54-
)
55-
56-
SET(BOOST_REQUIERED_COMPONENTS "")
57-
SET(BOOST_BUILD_COMPONENTS unit_test_framework)
58-
SET(BOOST_OPTIONAL_COMPONENTS "")
59-
60-
SET(BOOST_COMPONENTS ${BOOST_REQUIERED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
29+
SET(BOOST_COMPONENTS unit_test_framework)
6130
SEARCH_FOR_BOOST()
62-
63-
# Path to boost headers
6431
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
6532

6633
# --- PACKAGING ----------------------------------------------------------------
6734
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
6835

36+
ADD_SUBDIRECTORY(include/${PROJECT_NAME})
6937
ADD_SUBDIRECTORY(unittest)
7038

7139
SETUP_PROJECT_FINALIZE()

include/eiquadprog/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SET(${PROJECT_NAME}_HEADERS
2+
eiquadprog.hpp
3+
eiquadprog-fast.hpp
4+
eiquadprog-fast.hxx
5+
)
6+
7+
INSTALL(FILES
8+
${${PROJECT_NAME}_HEADERS}
9+
DESTINATION include/${PROJECT_NAME}
10+
)

include/eiquadprog/eiquadprog-fast.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
//
22
// Copyright (c) 2017 CNRS
33
//
4-
// This file is part of eiquadprog
5-
// eiquadprog is free software: you can redistribute it
6-
// and/or modify it under the terms of the GNU Lesser General Public
7-
// License as published by the Free Software Foundation, either version
8-
// 3 of the License, or (at your option) any later version.
9-
// eiquadprog is distributed in the hope that it will be
10-
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11-
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12-
// General Lesser Public License for more details. You should have
13-
// received a copy of the GNU Lesser General Public License along with
14-
// eiquadprog If not, see
15-
// <http://www.gnu.org/licenses/>.
16-
//
174

185
#ifndef EIQUADPROGFAST_HPP_
196
#define EIQUADPROGFAST_HPP_

include/eiquadprog/eiquadprog-fast.hxx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
//
22
// Copyright (c) 2017 CNRS
33
//
4-
// This file is part of eiquadprog
5-
// eiquadprog is free software: you can redistribute it
6-
// and/or modify it under the terms of the GNU Lesser General Public
7-
// License as published by the Free Software Foundation, either version
8-
// 3 of the License, or (at your option) any later version.
9-
// eiquadprog is distributed in the hope that it will be
10-
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11-
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12-
// General Lesser Public License for more details. You should have
13-
// received a copy of the GNU Lesser General Public License along with
14-
// eiquadprog If not, see
15-
// <http://www.gnu.org/licenses/>.
16-
//
174

185
#ifndef EIQUADPROGFAST_HXX_
196
#define EIQUADPROGFAST_HXX_
20-
7+
218
namespace eiquadprog
229
{
2310
namespace solvers
@@ -43,7 +30,7 @@ namespace eiquadprog
4330
}
4431
return a1 * std::sqrt(2.0);
4532
}
46-
33+
4734
EiquadprogFast::EiquadprogFast()
4835
{
4936
m_maxIter = DEFAULT_MAX_ITER;
@@ -177,7 +164,7 @@ namespace eiquadprog
177164
size_t& iq,
178165
size_t l)
179166
{
180-
167+
181168
size_t nVars = R.rows();
182169
#ifdef TRACE_SOLVER
183170
std::cerr << "Delete constraint " << l << ' ' << iq;
@@ -705,8 +692,8 @@ l2a:/* Step 2a: determine step direction */
705692

706693
goto l2a;
707694
}
708-
695+
709696
} /* namespace solvers */
710697
} /* namespace eiquadprog */
711698

712-
#endif /* EIQUADPROGFAST_HXX_ */
699+
#endif /* EIQUADPROGFAST_HXX_ */

unittest/CMakeLists.txt

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
1+
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
12

23
#test paths and names (without .cpp extension)
34
SET (TESTS
45
eiquadprog-basic
56
eiquadprog-fast
67
)
78

8-
# --- MACROS ------------------------------------------------------------------
9-
10-
MACRO(ADD_TEST_CFLAGS target flag)
11-
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
12-
ENDMACRO(ADD_TEST_CFLAGS)
13-
14-
MACRO(ADD_EIQUADPROG_UNIT_TEST NAME)
15-
SET(TEST_NAME "${NAME}-test")
16-
ADD_UNIT_TEST(${TEST_NAME} ${NAME}.cpp)
17-
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
18-
TARGET_INCLUDE_DIRECTORIES(${TEST_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
19-
20-
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_DYN_LINK")
21-
SET(MODULE_NAME "${NAME}Test")
22-
STRING(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME})
23-
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
24-
25-
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} eigen3)
26-
27-
# TARGET_LINK_LIBRARIES(${TEST_NAME} ${PROJECT_NAME})
28-
TARGET_LINK_LIBRARIES(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
29-
ENDMACRO(ADD_EIQUADPROG_UNIT_TEST)
30-
31-
FOREACH(TEST ${TESTS})
32-
ADD_EIQUADPROG_UNIT_TEST(${TEST})
33-
ENDFOREACH(TEST)
9+
FOREACH(test ${TESTS})
10+
ADD_UNIT_TEST(${test} ${test})
11+
TARGET_LINK_LIBRARIES(${test} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
12+
PKG_CONFIG_USE_DEPENDENCY(${test} eigen3)
13+
ENDFOREACH(test ${TESTS})

unittest/eiquadprog-basic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE ( test_full )
216216
Eigen::VectorXi activeSet(2);
217217
size_t activeSetSize;
218218

219-
Eigen::VectorXd solution(1);
219+
Eigen::VectorXd solution(2);
220220
solution(0) = 2.;
221221
solution(1) = 3.;
222222

unittest/eiquadprog-fast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE ( test_full )
234234

235235
Eigen::VectorXd x(2);
236236

237-
Eigen::VectorXd solution(1);
237+
Eigen::VectorXd solution(2);
238238
solution(0) = 2.;
239239
solution(1) = 3.;
240240

0 commit comments

Comments
 (0)