cmake/FindCPLEX.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 11 Aug 2013 12:53:30 +0200
branch1.1
changeset 815 eaed91c09e0f
parent 631 6dc44006c1a8
permissions -rw-r--r--
Release series 1.1.x has reached its end of life.
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
alpar@780
     5
  PATHS "C:/ILOG/CPLEX/include"
alpar@780
     6
  PATHS "/opt/ilog/cplex/include"
ladanyi@630
     7
  HINTS ${CPLEX_ROOT_DIR}/include
ladanyi@630
     8
)
ladanyi@612
     9
FIND_LIBRARY(CPLEX_LIBRARY
alpar@780
    10
  cplex
alpar@780
    11
  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
alpar@780
    12
  PATHS "/opt/ilog/cplex/bin"
ladanyi@630
    13
  HINTS ${CPLEX_ROOT_DIR}/bin
alpar@780
    14
  HINTS ${CPLEX_ROOT_DIR}/lib
ladanyi@630
    15
)
ladanyi@612
    16
ladanyi@612
    17
INCLUDE(FindPackageHandleStandardArgs)
ladanyi@612
    18
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
ladanyi@612
    19
ladanyi@612
    20
FIND_PATH(CPLEX_BIN_DIR
alpar@780
    21
  cplex.dll
alpar@780
    22
  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
alpar@780
    23
  HINTS ${CPLEX_ROOT_DIR}/bin
ladanyi@630
    24
)
ladanyi@612
    25
ladanyi@612
    26
IF(CPLEX_FOUND)
ladanyi@612
    27
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
ladanyi@612
    28
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
ladanyi@631
    29
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@631
    30
    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
ladanyi@631
    31
  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
ladanyi@612
    32
ENDIF(CPLEX_FOUND)
ladanyi@612
    33
ladanyi@612
    34
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
ladanyi@612
    35
ladanyi@612
    36
IF(CPLEX_FOUND)
ladanyi@622
    37
  SET(LEMON_HAVE_LP TRUE)
ladanyi@622
    38
  SET(LEMON_HAVE_MIP TRUE)
ladanyi@622
    39
  SET(LEMON_HAVE_CPLEX TRUE)
ladanyi@612
    40
ENDIF(CPLEX_FOUND)