1.1 --- a/CMakeLists.txt Thu Feb 28 23:45:39 2013 +0100
1.2 +++ b/CMakeLists.txt Mon Jul 15 08:33:08 2013 +0200
1.3 @@ -61,9 +61,64 @@
1.4
1.5 FIND_PACKAGE(Doxygen)
1.6 FIND_PACKAGE(Ghostscript)
1.7 -FIND_PACKAGE(GLPK 4.33)
1.8 -FIND_PACKAGE(CPLEX)
1.9 -FIND_PACKAGE(COIN)
1.10 +
1.11 +SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
1.12 +SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
1.13 +SET(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.")
1.14 +
1.15 +IF(LEMON_ENABLE_GLPK)
1.16 + FIND_PACKAGE(GLPK 4.33)
1.17 +ENDIF(LEMON_ENABLE_GLPK)
1.18 +IF(LEMON_ENABLE_ILOG)
1.19 + FIND_PACKAGE(ILOG)
1.20 +ENDIF(LEMON_ENABLE_ILOG)
1.21 +IF(LEMON_ENABLE_COIN)
1.22 + FIND_PACKAGE(COIN)
1.23 +ENDIF(LEMON_ENABLE_COIN)
1.24 +
1.25 +IF(GLPK_FOUND)
1.26 + SET(LEMON_HAVE_LP TRUE)
1.27 + SET(LEMON_HAVE_MIP TRUE)
1.28 + SET(LEMON_HAVE_GLPK TRUE)
1.29 +ENDIF(GLPK_FOUND)
1.30 +IF(ILOG_FOUND)
1.31 + SET(LEMON_HAVE_LP TRUE)
1.32 + SET(LEMON_HAVE_MIP TRUE)
1.33 + SET(LEMON_HAVE_ILOG TRUE)
1.34 +ENDIF(ILOG_FOUND)
1.35 +IF(COIN_FOUND)
1.36 + SET(LEMON_HAVE_LP TRUE)
1.37 + SET(LEMON_HAVE_MIP TRUE)
1.38 + SET(LEMON_HAVE_CLP TRUE)
1.39 + SET(LEMON_HAVE_CBC TRUE)
1.40 +ENDIF(COIN_FOUND)
1.41 +
1.42 +IF(ILOG_FOUND)
1.43 + SET(DEFAULT_LP "CPLEX")
1.44 + SET(DEFAULT_MIP "CPLEX")
1.45 +ELSEIF(COIN_FOUND)
1.46 + SET(DEFAULT_LP "CLP")
1.47 + SET(DEFAULT_MIP "CBC")
1.48 +ELSEIF(GLPK_FOUND)
1.49 + SET(DEFAULT_LP "GLPK")
1.50 + SET(DEFAULT_MIP "GLPK")
1.51 +ENDIF()
1.52 +
1.53 +IF(NOT LEMON_DEFAULT_LP OR
1.54 + (NOT ILOG_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CPLEX")) OR
1.55 + (NOT COIN_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CLP")) OR
1.56 + (NOT GLPK_FOUND AND (LEMON_DEFAULT_LP STREQUAL "GLPK")))
1.57 + SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
1.58 + "Default LP solver backend (GLPK, CPLEX or CLP)" FORCE)
1.59 +ENDIF()
1.60 +IF(NOT LEMON_DEFAULT_MIP OR
1.61 + (NOT ILOG_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CPLEX")) OR
1.62 + (NOT COIN_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CBC")) OR
1.63 + (NOT GLPK_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "GLPK")))
1.64 + SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
1.65 + "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
1.66 +ENDIF()
1.67 +
1.68
1.69 IF(DEFINED ENV{LEMON_CXX_WARNING})
1.70 SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})