COIN-OR::LEMON - Graph Library

source: lemon-main/cmake/FindCPLEX.cmake @ 822:f903263902f6

Last change on this file since 822:f903263902f6 was 636:6dc44006c1a8, checked in by Akos Ladanyi <ladanyi@…>, 16 years ago

Link libm and libpthread if using CPLEX (#277)

File size: 1009 bytes
RevLine 
[635]1SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
2
[620]3FIND_PATH(CPLEX_INCLUDE_DIR
4  ilcplex/cplex.h
[635]5  PATHS "C:/ILOG/CPLEX91/include"
6  PATHS "/opt/ilog/cplex91/include"
7  HINTS ${CPLEX_ROOT_DIR}/include
8)
[620]9FIND_LIBRARY(CPLEX_LIBRARY
[635]10  cplex91
11  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
12  PATHS "/opt/ilog/cplex91/bin"
13  HINTS ${CPLEX_ROOT_DIR}/bin
14)
[620]15
16INCLUDE(FindPackageHandleStandardArgs)
17FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
18
19FIND_PATH(CPLEX_BIN_DIR
20  cplex91.dll
[635]21  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
22)
[620]23
24IF(CPLEX_FOUND)
25  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
26  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
[636]27  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
28    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
29  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
[620]30ENDIF(CPLEX_FOUND)
31
32MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
33
34IF(CPLEX_FOUND)
[627]35  SET(LEMON_HAVE_LP TRUE)
36  SET(LEMON_HAVE_MIP TRUE)
37  SET(LEMON_HAVE_CPLEX TRUE)
[620]38ENDIF(CPLEX_FOUND)
Note: See TracBrowser for help on using the repository browser.