Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync FindIPOPT.cmake with YCM #689

Merged
merged 2 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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