cmake: rework gurobi support

This commit is contained in:
Mizux Seiha
2023-09-20 16:09:56 +02:00
committed by Corentin Le Molgat
parent 3a5008601a
commit 2899beb8f3
2 changed files with 8 additions and 1 deletions

View File

@@ -235,6 +235,10 @@ if(USE_GLPK)
message(STATUS "Build GLPK: ${BUILD_GLPK}")
endif()
## GUROBI
# Since it is dynamicaly loaded upon use, OFF is currently not supported.
CMAKE_DEPENDENT_OPTION(USE_GUROBI "Use the Gurobi solver" ON "BUILD_CXX" OFF)
## HiGHS
# see: https://github.com/ERGO-Code/HiGHS
CMAKE_DEPENDENT_OPTION(USE_HIGHS "Use the HiGHS solver" OFF "BUILD_CXX" OFF)

View File

@@ -52,6 +52,9 @@ if(USE_GLPK)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_GLPK")
set(GLPK_DIR glpk)
endif()
if(USE_GUROBI)
set(GUROBI_DIR gurobi)
endif()
if(USE_HIGHS)
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_HIGHS")
endif()
@@ -283,7 +286,7 @@ foreach(SUBPROJECT IN ITEMS
${GSCIP_DIR}
glop
graph
gurobi
${GUROBI_DIR}
init
linear_solver
lp_data