diff --git a/CMakeLists.txt b/CMakeLists.txt index efe0affe71d3869218d9c2fd8aa25499197cf60f..8d0766dc341c3e0773e14d3c0e5941cc4a0db55b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.6) INCLUDE(cmake/base.cmake) INCLUDE(cmake/test.cmake) INCLUDE(cmake/python.cmake) -INCLUDE(cmake2/FindqpOASES.cmake) SET(PROJECT_ORG stonneau) SET(PROJECT_NAME hpp-centroidal-dynamics) @@ -51,7 +50,12 @@ else() endif() #SEARCH_FOR_QPOASES() -ADD_REQUIRED_DEPENDENCY("qpOASES") +#ADD_REQUIRED_DEPENDENCY("qpOASES") +SET(QPOASES_PREFIX ${CMAKE_PREFIX_PATH} CACHE PATH "Set the prefix where qpOASES is installed") +FIND_LIBRARY(QPOASES_LIBRARY "qpOASES" PATHS ${QPOASES_PREFIX} PATH_SUFFIXES lib) +FIND_PATH(QPOASES_INCLUDE_DIRS NAMES "qpOASES.hpp" PATHS ${QPOASES_PREFIX} PATH_SUFFIXES include) +INCLUDE_DIRECTORIES(${QPOASES_INCLUDE_DIRS}) + ADD_SUBDIRECTORY (include/${CUSTOM_HEADER_DIR}) add_subdirectory (src) diff --git a/cmake2/FindqpOASES.cmake b/cmake2/FindqpOASES.cmake deleted file mode 100644 index 0f349c647571c52100c0f840c4a1faa54b82f1b7..0000000000000000000000000000000000000000 --- a/cmake2/FindqpOASES.cmake +++ /dev/null @@ -1,53 +0,0 @@ -#.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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db62488daa377e128358d52701fd834d02062e85..dd6826378aad48463dcf012a71d7ca9fe4e0a5ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,9 +19,8 @@ SET(${LIBRARY_NAME}_SOURCES ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES}) -TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CDD_LIBRARIES}) +TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CDD_LIBRARIES} ${QPOASES_LIBRARY}) PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigen3) -PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} qpOASES) if(CLP_FOUND) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CLP_LIBRARIES} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b8dd2f6ce2b4444d0cb29b450cedf2c95a89815a..3271bad73ffcfd4bd4e143d150e25fc38037c42f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,5 @@ PKG_CONFIG_USE_DEPENDENCY(static-equilibrium eigen3) TARGET_LINK_LIBRARIES(static-equilibrium ${PROJECT_NAME}) ADD_UNIT_TEST(lp-solvers test_LP_solvers) -PKG_CONFIG_USE_DEPENDENCY(lp-solvers qpOASES) PKG_CONFIG_USE_DEPENDENCY(lp-solvers eigen3) -TARGET_LINK_LIBRARIES(lp-solvers ${PROJECT_NAME}) +TARGET_LINK_LIBRARIES(lp-solvers ${PROJECT_NAME} ${QPOASES_LIBRARY})