cmake/FindCPLEX.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Tue, 06 Aug 2013 12:21:06 +0200
branch1.2
changeset 981 2c2e8df67ddc
parent 636 6dc44006c1a8
permissions -rw-r--r--
Merge further fixes #470 to branch 1.2
ladanyi@635
     1
SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
ladanyi@635
     2
ladanyi@620
     3
FIND_PATH(CPLEX_INCLUDE_DIR
ladanyi@620
     4
  ilcplex/cplex.h
alpar@950
     5
  PATHS "C:/ILOG/CPLEX/include"
alpar@950
     6
  PATHS "/opt/ilog/cplex/include"
ladanyi@635
     7
  HINTS ${CPLEX_ROOT_DIR}/include
ladanyi@635
     8
)
ladanyi@620
     9
FIND_LIBRARY(CPLEX_LIBRARY
alpar@950
    10
  cplex
alpar@950
    11
  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
alpar@950
    12
  PATHS "/opt/ilog/cplex/bin"
ladanyi@635
    13
  HINTS ${CPLEX_ROOT_DIR}/bin
alpar@950
    14
  HINTS ${CPLEX_ROOT_DIR}/lib
ladanyi@635
    15
)
ladanyi@620
    16
ladanyi@620
    17
INCLUDE(FindPackageHandleStandardArgs)
ladanyi@620
    18
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
ladanyi@620
    19
ladanyi@620
    20
FIND_PATH(CPLEX_BIN_DIR
alpar@950
    21
  cplex.dll
alpar@950
    22
  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
alpar@950
    23
  HINTS ${CPLEX_ROOT_DIR}/bin
ladanyi@635
    24
)
ladanyi@620
    25
ladanyi@620
    26
IF(CPLEX_FOUND)
ladanyi@620
    27
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
ladanyi@620
    28
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
ladanyi@636
    29
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@636
    30
    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
ladanyi@636
    31
  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@620
    32
ENDIF(CPLEX_FOUND)
ladanyi@620
    33
ladanyi@620
    34
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
ladanyi@620
    35
ladanyi@620
    36
IF(CPLEX_FOUND)
ladanyi@627
    37
  SET(LEMON_HAVE_LP TRUE)
ladanyi@627
    38
  SET(LEMON_HAVE_MIP TRUE)
ladanyi@627
    39
  SET(LEMON_HAVE_CPLEX TRUE)
ladanyi@620
    40
ENDIF(CPLEX_FOUND)