Commit 7926ba2d authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

FindGUROBI: Made it more user friendly and added support for libgurobi46.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13062 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 45db73ba
......@@ -41,10 +41,6 @@ ELSE( WIN32 )
IF(GUROBI_INCLUDE_DIR)
SET(GUROBI_FOUND TRUE)
SET(GUROBI_INCLUDE_DIR ${GUROBI_INCLUDE_DIR})
SET(GUROBI_LIBRARY_DIR "$ENV{GUROBI_HOME}/lib/" CACHE PATH "Path to GUROBI Library")
SET(GUROBI_LIBRARY "gurobi45;gurobi_c++;pthread" CACHE STRING "GUROBI Libraries")
MESSAGE(STATUS "${GUROBI_LIBRARY_DIR}")
MESSAGE(STATUS "${GUROBI_LIBRARY}")
ELSE(GUROBI_INCLUDE_DIR)
SET(GUROBI_FOUND FALSE)
SET(GUROBI_INCLUDE_DIR ${GUROBI_INCLUDE_DIR})
......@@ -55,5 +51,21 @@ ELSE( WIN32 )
# PATHS "${GUROBI_HOME}/lib" )
ENDIF()
endif(GUROBI_INCLUDE_DIR)
IF(UNIX)
IF(GUROBI_INCLUDE_DIR AND NOT GUROBI_LIBRARY)
IF (NOT DEFINED ENV{GUROBI_HOME})
message(FATAL_ERROR "Environment variable GUROBI_HOME not set. Set it so I can find the gurobi libs in \${GUROBI_HOME}/lib/.")
ENDIF()
SET(GUROBI_LIBRARY_DIR "$ENV{GUROBI_HOME}/lib/" CACHE PATH "Path to GUROBI Library")
IF (EXISTS "${GUROBI_LIBRARY_DIR}/libgurobi45.so")
SET(GUROBI_LIBRARY "gurobi45;gurobi_c++;pthread" CACHE STRING "GUROBI Libraries")
ELSEIF(EXISTS "${GUROBI_LIBRARY_DIR}/libgurobi46.so")
SET(GUROBI_LIBRARY "gurobi46;gurobi_c++;pthread" CACHE STRING "GUROBI Libraries")
ELSE()
message(FATAL_ERROR "Couldn't find a gurobi lib in ${GUROBI_LIBRARY_DIR}. Maybe it's a version I don't know about, yet.")
ENDIF()
ENDIF()
ENDIF(UNIX)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment