From 9788b61be86f5be1c536cdadb24de9df590317ab Mon Sep 17 00:00:00 2001
From: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de>
Date: Tue, 27 Nov 2018 17:13:47 +0100
Subject: [PATCH] FindIPOpt.cmake: add IPOPT_ROOT variable

This matches how to specify search directories for optional
dependencies in DUNE's core modules.
---
 cmake/modules/FindIPOpt.cmake | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/cmake/modules/FindIPOpt.cmake b/cmake/modules/FindIPOpt.cmake
index 38f276c7..4c885f07 100644
--- a/cmake/modules/FindIPOpt.cmake
+++ b/cmake/modules/FindIPOpt.cmake
@@ -8,18 +8,33 @@ find_library(DL_LIBRARY dl)
 
 find_path(IPOPT_INCLUDE_DIR
   NAMES "IpNLP.hpp"
+  PATHS ${IPOPT_ROOT}
   PATH_SUFFIXES "include" "include/coin"
+  NO_DEFAULT_PATH
+)
+find_path(IPOPT_INCLUDE_DIR
+  NAMES "IpNLP.hpp"
 )
 
 find_library(IPOPT_LIBRARY
   NAMES ipopt
+  PATHS ${IPOPT_ROOT}
   PATH_SUFFIXES "lib"
+  NO_DEFAULT_PATH
+)
+find_library(IPOPT_LIBRARY
+  NAMES ipopt
 )
 
 # If you want to want to use other linear solver
 find_library(HSL_LIBRARY
   NAMES hsl coinhsl
+  PATHS ${IPOPT_ROOT}
   PATH_SUFFIXES "lib"
+  NO_DEFAULT_PATH
+)
+find_library(HSL_LIBRARY
+  NAMES hsl coinhsl
 )
 
 find_package_handle_standard_args(hsl DEFAULT_MSG HSL_LIBRARY)
-- 
GitLab