cmake/FindCPLEX.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 07 Mar 2010 09:49:42 +0000
branch1.1
changeset 721 0a48b28c6683
parent 630 89705c452130
child 780 1818cc848005
permissions -rw-r--r--
LEMON 1.1.2 released (86a880ba752d tagged as r1.1.2)
ladanyi@630
     1
SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
ladanyi@630
     2
ladanyi@612
     3
FIND_PATH(CPLEX_INCLUDE_DIR
ladanyi@612
     4
  ilcplex/cplex.h
ladanyi@630
     5
  PATHS "C:/ILOG/CPLEX91/include"
ladanyi@630
     6
  PATHS "/opt/ilog/cplex91/include"
ladanyi@630
     7
  HINTS ${CPLEX_ROOT_DIR}/include
ladanyi@630
     8
)
ladanyi@612
     9
FIND_LIBRARY(CPLEX_LIBRARY
ladanyi@630
    10
  cplex91
ladanyi@630
    11
  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
ladanyi@630
    12
  PATHS "/opt/ilog/cplex91/bin"
ladanyi@630
    13
  HINTS ${CPLEX_ROOT_DIR}/bin
ladanyi@630
    14
)
ladanyi@612
    15
ladanyi@612
    16
INCLUDE(FindPackageHandleStandardArgs)
ladanyi@612
    17
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
ladanyi@612
    18
ladanyi@612
    19
FIND_PATH(CPLEX_BIN_DIR
ladanyi@612
    20
  cplex91.dll
ladanyi@630
    21
  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
ladanyi@630
    22
)
ladanyi@612
    23
ladanyi@612
    24
IF(CPLEX_FOUND)
ladanyi@612
    25
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
ladanyi@612
    26
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
ladanyi@631
    27
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@631
    28
    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
ladanyi@631
    29
  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@612
    30
ENDIF(CPLEX_FOUND)
ladanyi@612
    31
ladanyi@612
    32
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
ladanyi@612
    33
ladanyi@612
    34
IF(CPLEX_FOUND)
ladanyi@622
    35
  SET(LEMON_HAVE_LP TRUE)
ladanyi@622
    36
  SET(LEMON_HAVE_MIP TRUE)
ladanyi@622
    37
  SET(LEMON_HAVE_CPLEX TRUE)
ladanyi@612
    38
ENDIF(CPLEX_FOUND)