Skip to content

Commit

Permalink
cmake: Fix configure when solver are disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Oct 18, 2024
1 parent b620d7e commit 80087b8
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 138 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ if(USE_COINOR)
CMAKE_DEPENDENT_OPTION(BUILD_Cbc "Build the Cbc dependency Library" OFF
"NOT BUILD_DEPS" ON)
message(STATUS "Build Cbc: ${BUILD_Cbc}")
else()
set(BUILD_CoinUtils OFF)
set(BUILD_Osi OFF)
set(BUILD_Clp OFF)
set(BUILD_Cgl OFF)
set(BUILD_Cbc OFF)
endif()

## GLOP
Expand All @@ -253,6 +259,8 @@ if(USE_GLPK)
CMAKE_DEPENDENT_OPTION(BUILD_GLPK "Build the GLPK dependency Library" OFF
"NOT BUILD_DEPS" ON)
message(STATUS "Build GLPK: ${BUILD_GLPK}")
else()
set(BUILD_GLPK OFF)
endif()

## GUROBI
Expand All @@ -268,6 +276,8 @@ if(USE_HIGHS)
CMAKE_DEPENDENT_OPTION(BUILD_HIGHS "Build the HiGHS dependency Library" OFF
"NOT BUILD_DEPS" ON)
message(STATUS "Build HiGHS: ${BUILD_HIGHS}")
else()
set(BUILD_HIGHS OFF)
endif()

## PDLP
Expand All @@ -277,6 +287,8 @@ if(USE_PDLP)
CMAKE_DEPENDENT_OPTION(BUILD_PDLP "Build the PDLP dependency Library" ON
"NOT BUILD_DEPS" ON)
message(STATUS "Build PDLP: ${BUILD_PDLP}")
else()
set(BUILD_PDLP OFF)
endif()

## SCIP
Expand All @@ -287,6 +299,8 @@ if(USE_SCIP)
CMAKE_DEPENDENT_OPTION(BUILD_SCIP "Build the SCIP dependency Library" OFF
"NOT BUILD_DEPS" ON)
message(STATUS "Build SCIP: ${BUILD_SCIP}")
else()
set(BUILD_SCIP OFF)
endif()

# Optional third party solvers (disabled by default)
Expand Down
28 changes: 14 additions & 14 deletions cmake/java.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,42 +373,42 @@ add_custom_command(
$<TARGET_SONAME_FILE:absl::vlog_config_internal>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Protobuf}>,copy,true>
$<TARGET_SONAME_FILE:protobuf::libprotobuf>
$<IF:$<BOOL:${BUILD_re2}>,copy,true>
$<$<BOOL:${BUILD_re2}>:$<TARGET_SONAME_FILE:re2::re2>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_re2}>,copy,true>
$<TARGET_SONAME_FILE:re2::re2>
$<IF:$<BOOL:${BUILD_Protobuf}>,copy,true>
$<$<BOOL:${BUILD_Protobuf}>:$<TARGET_SONAME_FILE:protobuf::libprotobuf>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/

COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_CoinUtils}>,copy,true>
$<TARGET_SONAME_FILE:Coin::CoinUtils>
$<$<BOOL:${BUILD_CoinUtils}>:$<TARGET_SONAME_FILE:Coin::CoinUtils>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Osi}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Osi>
$<$<BOOL:${BUILD_Osi}>:$<TARGET_SONAME_FILE:Coin::Osi>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Clp}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Clp>
$<TARGET_SONAME_FILE:Coin::OsiClp>
$<TARGET_SONAME_FILE:Coin::ClpSolver>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::Clp>>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::OsiClp>>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::ClpSolver>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Cgl}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Cgl>
$<$<BOOL:${BUILD_Cgl}>:$<TARGET_SONAME_FILE:Coin::Cgl>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Cbc}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Cbc>
$<TARGET_SONAME_FILE:Coin::OsiCbc>
$<TARGET_SONAME_FILE:Coin::CbcSolver>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::Cbc>>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::OsiCbc>>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::CbcSolver>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/

COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_HIGHS}>,copy,true>
$<TARGET_SONAME_FILE:highs>
$<$<BOOL:${BUILD_HIGHS}>:$<TARGET_SONAME_FILE:highs>>
${JAVA_RESSOURCES_PATH}/${JAVA_NATIVE_PROJECT}/

COMMAND ${MAVEN_EXECUTABLE} compile -B
Expand Down
62 changes: 31 additions & 31 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -527,48 +527,48 @@ add_custom_command(
$<TARGET_SONAME_FILE:absl::vlog_config_internal>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_re2}>,copy,true>
$<TARGET_SONAME_FILE:re2::re2>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_re2}>,copy,true>
$<$<BOOL:${BUILD_re2}>:$<TARGET_SONAME_FILE:re2::re2>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Protobuf}>,copy,true>
$<TARGET_SONAME_FILE:protobuf::libprotobuf>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_Protobuf}>,copy,true>
$<$<BOOL:${BUILD_Protobuf}>:$<TARGET_SONAME_FILE:protobuf::libprotobuf>>
${PYTHON_PROJECT}/.libs

COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_CoinUtils}>,copy,true>
$<TARGET_SONAME_FILE:Coin::CoinUtils>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_CoinUtils}>,copy,true>
$<$<BOOL:${BUILD_CoinUtils}>:$<TARGET_SONAME_FILE:Coin::CoinUtils>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Osi}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Osi>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_Osi}>,copy,true>
$<$<BOOL:${BUILD_Osi}>:$<TARGET_SONAME_FILE:Coin::Osi>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Clp}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Clp>
$<TARGET_SONAME_FILE:Coin::OsiClp>
$<TARGET_SONAME_FILE:Coin::ClpSolver>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_Clp}>,copy,true>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::Clp>>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::OsiClp>>
$<$<BOOL:${BUILD_Clp}>:$<TARGET_SONAME_FILE:Coin::ClpSolver>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Cgl}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Cgl>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_Cgl}>,copy,true>
$<$<BOOL:${BUILD_Cgl}>:$<TARGET_SONAME_FILE:Coin::Cgl>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_Cbc}>,copy,true>
$<TARGET_SONAME_FILE:Coin::Cbc>
$<TARGET_SONAME_FILE:Coin::OsiCbc>
$<TARGET_SONAME_FILE:Coin::CbcSolver>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_Cbc}>,copy,true>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::Cbc>>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::OsiCbc>>
$<$<BOOL:${BUILD_Cbc}>:$<TARGET_SONAME_FILE:Coin::CbcSolver>>
${PYTHON_PROJECT}/.libs

COMMAND ${CMAKE_COMMAND} -E
$<IF:$<BOOL:${BUILD_HIGHS}>,copy,true>
$<TARGET_SONAME_FILE:highs>
${PYTHON_PROJECT}/.libs
$<IF:$<BOOL:${BUILD_HIGHS}>,copy,true>
$<$<BOOL:${BUILD_HIGHS}>:$<TARGET_SONAME_FILE:highs>>
${PYTHON_PROJECT}/.libs

COMMAND ${CMAKE_COMMAND} -E
$<IF:$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>,copy,true>
$<$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>:$<TARGET_SONAME_FILE:ortools>>
${PYTHON_PROJECT}/.libs
$<IF:$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>,copy,true>
$<$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>:$<TARGET_SONAME_FILE:ortools>>
${PYTHON_PROJECT}/.libs
COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR}/python/ortools_timestamp
MAIN_DEPENDENCY
ortools/python/setup.py.in
Expand Down
Loading

0 comments on commit 80087b8

Please sign in to comment.