cmake/FindCPLEX.cmake
author Balazs Dezso <deba@google.com>
Tue, 12 Feb 2013 07:15:52 +0100
changeset 1030 4936be66d2f5
parent 636 6dc44006c1a8
permissions -rw-r--r--
Changes in BpGraph lgf reader and writer (#69)
- Add typesade RedNode and BlueNode reading and writing
- RedNodes and BlueNodes don't need to have distinct label set
- Add tests
     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/CPLEX/include"
     6   PATHS "/opt/ilog/cplex/include"
     7   HINTS ${CPLEX_ROOT_DIR}/include
     8 )
     9 FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex
    11   PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex/bin"
    13   HINTS ${CPLEX_ROOT_DIR}/bin
    14   HINTS ${CPLEX_ROOT_DIR}/lib
    15 )
    16 
    17 INCLUDE(FindPackageHandleStandardArgs)
    18 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    19 
    20 FIND_PATH(CPLEX_BIN_DIR
    21   cplex.dll
    22   PATHS "C:/ILOG/CPLEX/bin/x86_win32"
    23   HINTS ${CPLEX_ROOT_DIR}/bin
    24 )
    25 
    26 IF(CPLEX_FOUND)
    27   SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    28   SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    29   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    30     SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    31   ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    32 ENDIF(CPLEX_FOUND)
    33 
    34 MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    35 
    36 IF(CPLEX_FOUND)
    37   SET(LEMON_HAVE_LP TRUE)
    38   SET(LEMON_HAVE_MIP TRUE)
    39   SET(LEMON_HAVE_CPLEX TRUE)
    40 ENDIF(CPLEX_FOUND)