From a2190c04b0da754e0f0ef6ff7f4fa2d1aa478da8 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Wed, 20 Mar 2019 12:38:06 +0100 Subject: [PATCH] Added new versions to FindGurobi.cmake --- resources/3rdparty/CMakeLists.txt | 13 ++++++++++--- resources/cmake/find_modules/FindGurobi.cmake | 10 +++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index b331ed463..d04d0fc77 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -199,9 +199,16 @@ if (STORM_USE_GUROBI) find_package(Gurobi QUIET REQUIRED) set(STORM_HAVE_GUROBI ${GUROBI_FOUND}) if (GUROBI_FOUND) - message (STATUS "Storm - Linking with Gurobi.") - add_imported_library(Gurobi SHARED ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS}) - list(APPEND STORM_DEP_TARGETS Gurobi_SHARED) + if (EXISTS ${GUROBI_LIBRARY}) + message (STATUS "Storm - Linking with Gurobi.") + add_imported_library(Gurobi SHARED ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS}) + list(APPEND STORM_DEP_TARGETS Gurobi_SHARED) + else() + # The FindGurobi.cmake script needs to be updated every now and then as the library file contains the version number... + message(SEND_ERROR "Gurobi Library ${GUROBI_LIBRARY} not found. If your Gurobi Version is higher then 8.1.0, please contact the Storm developers.") + endif() + else() + message(SEND_ERROR "Gurobi Library requested but was not found. Make sure that GUROBI_ROOT points to the correct directory (containing include/ and lib/ subdirectories).") endif() else() set(STORM_HAVE_GUROBI OFF) diff --git a/resources/cmake/find_modules/FindGurobi.cmake b/resources/cmake/find_modules/FindGurobi.cmake index 502630148..da726a3cb 100644 --- a/resources/cmake/find_modules/FindGurobi.cmake +++ b/resources/cmake/find_modules/FindGurobi.cmake @@ -25,6 +25,8 @@ find_path(GUROBI_INCLUDE_DIR "/Library/gurobi651/mac64/include" "/Library/gurobi652/mac64/include" "/Library/gurobi702/mac64/include" + "/Library/gurobi801/mac64/include" + "/Library/gurobi810/mac64/include" "${GUROBI_ROOT}/include" ) @@ -41,7 +43,9 @@ find_library( GUROBI_LIBRARY gurobi65 gurobi70 gurobi75 - PATHS "$ENV{GUROBI_HOME}/lib" + gurobi80 + gurobi81 + PATHS "$ENV{GUROBI_HOME}/lib" "/Library/gurobi502/mac64/lib" "/Library/gurobi602/mac64/lib" "/Library/gurobi604/mac64/lib" @@ -50,6 +54,8 @@ find_library( GUROBI_LIBRARY "/Library/gurobi651/mac64/lib" "/Library/gurobi652/mac64/lib" "/Library/gurobi702/mac64/lib" + "/Library/gurobi801/mac64/lib" + "/Library/gurobi810/mac64/lib" "${GUROBI_ROOT}/lib" ) @@ -64,6 +70,8 @@ find_library( GUROBI_CXX_LIBRARY "/Library/gurobi651/mac64/lib" "/Library/gurobi652/mac64/lib" "/Library/gurobi702/mac64/lib" + "/Library/gurobi801/mac64/lib" + "/Library/gurobi810/mac64/lib" "${GUROBI_ROOT}/lib" )