Skip to content
Snippets Groups Projects
Commit d58ca69d authored by andreadelprete's avatar andreadelprete
Browse files

Modify CMakeLists.txt and installation instructions to use pkgconfig version of qpOases

parent 9924f13f
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,8 @@ else() ...@@ -61,7 +61,8 @@ else()
add_definitions(-DCLP_FOUND) add_definitions(-DCLP_FOUND)
endif() endif()
SEARCH_FOR_QPOASES() #SEARCH_FOR_QPOASES()
ADD_REQUIRED_DEPENDENCY("qpOASES")
add_subdirectory (src) add_subdirectory (src)
add_subdirectory (test) add_subdirectory (test)
......
...@@ -35,10 +35,18 @@ You can install Eigen3 with the following command: ...@@ -35,10 +35,18 @@ You can install Eigen3 with the following command:
``` ```
sudo apt-get install libeigen3-dev sudo apt-get install libeigen3-dev
``` ```
Install qpOases from sources following the instructions on its [webpage](https://projects.coin-or.org/qpOASES). For qpOases you have to install the pkg-config version you can find here: https://github.com/humanoid-path-planner/qpoases
Note that you need to compile qpOases into a dynamic library (not a static one). ```
git clone --recursive https://github.com/humanoid-path-planner/qpoases
mkdir qpoases/build
cd qpoases/build
cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install ..
make install
```
#Alternatively, you can install qpOases from sources following the instructions on its [webpage](https://projects.coin-or.org/qpOASES).
#Note that you need to compile qpOases into a dynamic library (not a static one).
Then you can clone the repository using ssh: Then you can clone this repository using ssh:
``` ```
git clone --recursive git@github.com:andreadelprete/robust-equilibrium-lib.git $ROBUST_EQUI_LIB_DIR git clone --recursive git@github.com:andreadelprete/robust-equilibrium-lib.git $ROBUST_EQUI_LIB_DIR
``` ```
...@@ -46,17 +54,17 @@ or using http: ...@@ -46,17 +54,17 @@ or using http:
``` ```
git clone --recursive https://github.com/andreadelprete/robust-equilibrium-lib.git $ROBUST_EQUI_LIB_DIR git clone --recursive https://github.com/andreadelprete/robust-equilibrium-lib.git $ROBUST_EQUI_LIB_DIR
``` ```
And you can build the library using CMake: And you can build this library using CMake:
``` ```
mkdir $ROBUST_EQUI_LIB_DIR/build mkdir $ROBUST_EQUI_LIB_DIR/build
cd $ROBUST_EQUI_LIB_DIR/build cd $ROBUST_EQUI_LIB_DIR/build
cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install .. cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install ..
make install make install
``` ```
Currently, CMake may have problems finding CDD and qpOases. Currently, CMake may have problems finding CDD.
If this is the case you can specify their paths manually, for instance: If this is the case you can specify its path manually, for instance:
``` ```
cmake -DCDD_LIBRARY=/usr/lib/libcdd.so -DqpOASES_INCLUDEDIR=${QP_OASES_DIR}/include -DqpOASES_LIB=${QP_OASES_DIR}/bin/libqpOASES.so -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install .. cmake -DCDD_LIBRARY=/usr/lib/libcdd.so -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install ..
``` ```
### Optional ### Optional
......
...@@ -4,7 +4,7 @@ include_directories("${SRC_DIR}") ...@@ -4,7 +4,7 @@ include_directories("${SRC_DIR}")
include_directories("${INCLUDE_DIR}") include_directories("${INCLUDE_DIR}")
include_directories("${EIGEN3_INCLUDE_DIR}") include_directories("${EIGEN3_INCLUDE_DIR}")
include_directories("${CDD_INCLUDE_DIR}") include_directories("${CDD_INCLUDE_DIR}")
include_directories("${qpOASES_INCLUDE_DIR}") # no need to include directories for qpOASES as it is automatically done through pkgconfig
if(CLP_FOUND) if(CLP_FOUND)
include_directories("${CLP_INCLUDE_DIR}") include_directories("${CLP_INCLUDE_DIR}")
...@@ -35,8 +35,9 @@ if ( MSVC ) ...@@ -35,8 +35,9 @@ if ( MSVC )
SET(CMAKE_DEBUG_POSTFIX d) SET(CMAKE_DEBUG_POSTFIX d)
endif ( MSVC ) endif ( MSVC )
TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CDD_LIBRARY} TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CDD_LIBRARY})
${qpOASES_LIBRARY}) PKG_CONFIG_USE_DEPENDENCY(robust-equilibrium-lib qpOASES)
if(CLP_FOUND) if(CLP_FOUND)
TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CLP_LIBRARY} TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CLP_LIBRARY}
/usr/lib/libCoinUtils.so) /usr/lib/libCoinUtils.so)
......
...@@ -4,7 +4,7 @@ include_directories("${SRC_DIR}") ...@@ -4,7 +4,7 @@ include_directories("${SRC_DIR}")
include_directories("${INCLUDE_DIR}") include_directories("${INCLUDE_DIR}")
include_directories("${EIGEN3_INCLUDE_DIR}") include_directories("${EIGEN3_INCLUDE_DIR}")
include_directories("${CDD_INCLUDE_DIR}") include_directories("${CDD_INCLUDE_DIR}")
include_directories("${qpOASES_INCLUDE_DIR}") # no need to include directories for qpOASES as it is automatically done through pkgconfig
if(CLP_FOUND) if(CLP_FOUND)
include_directories("${CLP_INCLUDE_DIR}") include_directories("${CLP_INCLUDE_DIR}")
endif() endif()
......
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