cmake/FindCPLEX.cmake
author Peter Kovacs <kpeter@inf.elte.hu>
Thu, 12 Nov 2009 23:26:13 +0100
changeset 806 fa6f37d7a25b
parent 635 89705c452130
child 972 1818cc848005
permissions -rw-r--r--
Entirely rework CapacityScaling (#180)

- Use the new interface similarly to NetworkSimplex.
- Rework the implementation using an efficient internal structure
for handling the residual network. This improvement made the
code much faster (up to 2-5 times faster on large graphs).
- Handle GEQ supply type (LEQ is not supported).
- Handle negative costs for arcs of finite capacity.
(Note that this algorithm cannot handle arcs of negative cost
and infinite upper bound, thus it returns UNBOUNDED if such
an arc exists.)
- Extend the documentation.
     1 SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
     2 
     3 FIND_PATH(CPLEX_INCLUDE_DIR
     4   ilcplex/cplex.h
     5   PATHS "C:/ILOG/CPLEX91/include"
     6   PATHS "/opt/ilog/cplex91/include"
     7   HINTS ${CPLEX_ROOT_DIR}/include
     8 )
     9 FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex91
    11   PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex91/bin"
    13   HINTS ${CPLEX_ROOT_DIR}/bin
    14 )
    15 
    16 INCLUDE(FindPackageHandleStandardArgs)
    17 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    18 
    19 FIND_PATH(CPLEX_BIN_DIR
    20   cplex91.dll
    21   PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
    22 )
    23 
    24 IF(CPLEX_FOUND)
    25   SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    26   SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    27   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    28     SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    29   ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    30 ENDIF(CPLEX_FOUND)
    31 
    32 MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    33 
    34 IF(CPLEX_FOUND)
    35   SET(LEMON_HAVE_LP TRUE)
    36   SET(LEMON_HAVE_MIP TRUE)
    37   SET(LEMON_HAVE_CPLEX TRUE)
    38 ENDIF(CPLEX_FOUND)