diff --git a/CMakeLists.txt b/CMakeLists.txt index 32cb3e2c4237a155abcaf2d40b4fa32f8031b2e4..361bc52c51ea544acfabfb89f4a45cea2b283436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,8 @@ else() add_definitions(-DCLP_FOUND) endif() -SEARCH_FOR_QPOASES() +#SEARCH_FOR_QPOASES() +ADD_REQUIRED_DEPENDENCY("qpOASES") add_subdirectory (src) add_subdirectory (test) diff --git a/README.md b/README.md index 4bee78e7eb219e6a2906e34baf420f21a8d02dd7..0789d2bfb32b378ce1e2f6af2647dd553891b634 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,18 @@ You can install Eigen3 with the following command: ``` sudo apt-get install libeigen3-dev ``` -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). +For qpOases you have to install the pkg-config version you can find here: https://github.com/humanoid-path-planner/qpoases +``` +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 ``` @@ -46,17 +54,17 @@ or using http: ``` 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 cd $ROBUST_EQUI_LIB_DIR/build cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install .. make install ``` -Currently, CMake may have problems finding CDD and qpOases. -If this is the case you can specify their paths manually, for instance: +Currently, CMake may have problems finding CDD. +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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a15ab0e3904a1024cf2b11718a87ab144692a52f..a61ad759135bac911521939363b1c18c780d4c4e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories("${SRC_DIR}") include_directories("${INCLUDE_DIR}") include_directories("${EIGEN3_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) include_directories("${CLP_INCLUDE_DIR}") @@ -35,8 +35,9 @@ if ( MSVC ) SET(CMAKE_DEBUG_POSTFIX d) endif ( MSVC ) -TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CDD_LIBRARY} - ${qpOASES_LIBRARY}) +TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CDD_LIBRARY}) +PKG_CONFIG_USE_DEPENDENCY(robust-equilibrium-lib qpOASES) + if(CLP_FOUND) TARGET_LINK_LIBRARIES(robust-equilibrium-lib ${CLP_LIBRARY} /usr/lib/libCoinUtils.so) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 55b06faa27ede4c2f736fbe85b6e936476377b51..7399b3e974689e768432e87487d2461d2ecaeb93 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories("${SRC_DIR}") include_directories("${INCLUDE_DIR}") include_directories("${EIGEN3_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) include_directories("${CLP_INCLUDE_DIR}") endif()