Skip to content
Snippets Groups Projects
Commit 320b9654 authored by Elias Pipping's avatar Elias Pipping Committed by pipping
Browse files

Call pkg-config less often

[[Imported from SVN: r5145]]
parent 45578ed6
Branches
Tags
No related merge requests found
......@@ -38,21 +38,22 @@ AS_IF([test x$with_ipopt != xno], [
AC_MSG_WARN([IPOpt not found in $IPOPTROOT])
])
AC_LANG_PUSH([C++])
LDFLAGS="$LDFLAGS -L$IPOPT_LIB_PATH"
IPOPT_LDFLAGS="`PKG_CONFIG_PATH=$IPOPT_LIB_PATH/pkgconfig $PKG_CONFIG --libs-only-L ipopt`"
LDFLAGS="$LDFLAGS $IPOPT_LDFLAGS"
IPOPT_CPPFLAGS="-I$IPOPTROOT/include"
CPPFLAGS="$CPPFLAGS $IPOPT_CPPFLAGS"
IPOPT_LIBS="`PKG_CONFIG_PATH=$IPOPT_LIB_PATH/pkgconfig $PKG_CONFIG --libs-only-l ipopt`"
LIBS="$LIBS $IPOPT_LIBS"
AC_LANG_PUSH([C++])
# if header is found...
AS_IF([test x$HAVE_IPOPT = x1], [
LIBS="$LIBS `PKG_CONFIG_PATH=$IPOPT_LIB_PATH/pkgconfig $PKG_CONFIG --libs ipopt`"
AC_LINK_IFELSE(AC_LANG_PROGRAM(
[#include "coin/IpIpoptApplication.hpp"],
[Ipopt::SmartPtr<Ipopt::IpoptApplication> app = new Ipopt::IpoptApplication();]),
[IPOPT_LIBS="`PKG_CONFIG_PATH=$IPOPT_LIB_PATH/pkgconfig $PKG_CONFIG --libs-only-l ipopt`"
IPOPT_LDFLAGS="`PKG_CONFIG_PATH=$IPOPT_LIB_PATH/pkgconfig $PKG_CONFIG --libs-only-L ipopt`"],
[],
[HAVE_IPOPT="0"
AC_MSG_WARN(IPOpt not found!)])
])
......@@ -76,7 +77,9 @@ AS_IF([test x$HAVE_IPOPT = x1], [
# set variable for summary
with_ipopt="yes"
], [
unset IPOPT_LIBS
AC_SUBST(IPOPT_LIBS, "")
unset IPOPT_LDFLAGS
AC_SUBST(IPOPT_LDFLAGS, "")
unset IPOPT_CPPFLAGS
AC_SUBST(IPOPT_CPPFLAGS, "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment