From 0b79dea019a9b258014454ac527f04f7d76763fd Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
Date: Thu, 5 Apr 2018 12:01:25 -0500
Subject: [PATCH 1/3] Use libhistory

---
 scip/cmake/Modules/FindReadline.cmake | 11 ++++++++---
 scip/src/CMakeLists.txt               |  3 ++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/scip/cmake/Modules/FindReadline.cmake b/scip/cmake/Modules/FindReadline.cmake
index 051a1e7..9f14b5f 100644
--- a/scip/cmake/Modules/FindReadline.cmake
+++ b/scip/cmake/Modules/FindReadline.cmake
@@ -31,14 +31,19 @@ find_library(Readline_LIBRARY
     HINTS ${Readline_ROOT_DIR}/lib
 )
 
-if(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+find_library(History_LIBRARY
+    NAMES history
+    HINTS ${Readline_ROOT_DIR}/lib
+)
+
+if(Readline_INCLUDE_DIR AND Readline_LIBRARY AND History_LIBRARY AND Ncurses_LIBRARY)
   set(READLINE_FOUND TRUE)
-else(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+else(Readline_INCLUDE_DIR AND Readline_LIBRARY AND History_LIBRARY AND Ncurses_LIBRARY)
   FIND_LIBRARY(Readline_LIBRARY NAMES readline)
   include(FindPackageHandleStandardArgs)
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY )
   MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY)
-endif(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY)
+endif(Readline_INCLUDE_DIR AND Readline_LIBRARY AND History_LIBRARY AND Ncurses_LIBRARY)
 
 mark_as_advanced(
     Readline_ROOT_DIR
diff --git a/scip/src/CMakeLists.txt b/scip/src/CMakeLists.txt
index bbe9c72..ef55fe7 100644
--- a/scip/src/CMakeLists.txt
+++ b/scip/src/CMakeLists.txt
@@ -803,6 +803,7 @@ setLibProperties(libscip "scip")
 target_link_libraries(libscip PRIVATE
     ${ZLIB_LIBRARIES}
     ${Readline_LIBRARY}
+    ${History_LIBRARY}
     ${GMP_LIBRARIES}
     ${THREAD_LIBRARIES}
     ${NLPI_LIBRARIES}
@@ -824,7 +825,7 @@ endif()
 
 target_compile_definitions(scip PRIVATE EXTERN=extern)
 
-target_link_libraries(scip ${ZLIB_LIBRARIES} ${Readline_LIBRARY} ${GMP_LIBRARIES}
+target_link_libraries(scip ${ZLIB_LIBRARIES} ${Readline_LIBRARY} ${History_LIBRARY} ${GMP_LIBRARIES}
    ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES} ${SYM_LIBRARIES} ${THREAD_LIBRARIES} ${NLPI_LIBRARIES})
 
 add_dependencies(libscip scip_update_githash)
-- 
2.11.0

