Skip to content

Commit

Permalink
Merge pull request #689 from robotology/traversaro-patch-1
Browse files Browse the repository at this point in the history
Sync FindIPOPT.cmake with YCM
  • Loading branch information
traversaro authored May 6, 2020
2 parents 83f306b + 02b24a6 commit a411166
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- Fixed compilation with ipopt installed via vcpkg (https://github.com/robotology/idyntree/pull/689).
- Fixed compilation with Visual Studio 2019 16.6 (https://github.com/robotology/idyntree/pull/672).

## [1.0.5] - 2020-04-03
Expand Down
19 changes: 7 additions & 12 deletions cmake/FindIPOPT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,14 @@ if(NOT WIN32)
set(IPOPT_DIR /usr CACHE PATH "Path to IPOPT build directory")
endif()

find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp PATH_SUFFIXES coin PATHS ${IPOPT_DIR}/include/coin)

find_library(IPOPT_LIBRARIES ipopt ${IPOPT_DIR}/lib
${IPOPT_DIR}/lib/coin
NO_DEFAULT_PATH)
${IPOPT_DIR}/lib/coin)

if(IPOPT_LIBRARIES)
find_file(IPOPT_DEP_FILE ipopt_addlibs_cpp.txt ${IPOPT_DIR}/share/doc/coin/Ipopt
${IPOPT_DIR}/share/coin/doc/Ipopt
NO_DEFAULT_PATH)
${IPOPT_DIR}/share/coin/doc/Ipopt)
mark_as_advanced(IPOPT_DEP_FILE)

if(IPOPT_DEP_FILE)
Expand All @@ -107,8 +105,7 @@ if(NOT WIN32)
foreach(LIB ${IPOPT_DEP})
find_library(IPOPT_SEARCH_FOR_${LIB} ${LIB} ${IPOPT_DIR}/lib
${IPOPT_DIR}/lib/coin
${IPOPT_DIR}/lib/coin/ThirdParty
NO_DEFAULT_PATH)
${IPOPT_DIR}/lib/coin/ThirdParty)
if(IPOPT_SEARCH_FOR_${LIB})
# handle non-system libraries (e.g. coinblas)
set(IPOPT_LIBRARIES ${IPOPT_LIBRARIES} ${IPOPT_SEARCH_FOR_${LIB}})
Expand All @@ -131,14 +128,12 @@ else()

set(IPOPT_DIR $ENV{IPOPT_DIR} CACHE PATH "Path to IPOPT build directory")

find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp PATH_SUFFIXES coin PATHS ${IPOPT_DIR}/include/coin)

find_library(IPOPT_IPOPT_LIBRARY_RELEASE libipopt ${IPOPT_DIR}/lib
${IPOPT_DIR}/lib/coin
NO_DEFAULT_PATH)
${IPOPT_DIR}/lib/coin)
find_library(IPOPT_IPOPT_LIBRARY_DEBUG libipoptD ${IPOPT_DIR}/lib
${IPOPT_DIR}/lib/coin
NO_DEFAULT_PATH)
${IPOPT_DIR}/lib/coin)

select_library_configurations(IPOPT_IPOPT)
set(IPOPT_LIBRARIES ${IPOPT_IPOPT_LIBRARY})
Expand Down

0 comments on commit a411166

Please sign in to comment.