cmake/FindCPLEX.cmake
changeset 784 1a7fe3bef514
parent 635 89705c452130
child 972 1818cc848005
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cmake/FindCPLEX.cmake	Thu Nov 05 15:50:01 2009 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
     1.5 +
     1.6 +FIND_PATH(CPLEX_INCLUDE_DIR
     1.7 +  ilcplex/cplex.h
     1.8 +  PATHS "C:/ILOG/CPLEX91/include"
     1.9 +  PATHS "/opt/ilog/cplex91/include"
    1.10 +  HINTS ${CPLEX_ROOT_DIR}/include
    1.11 +)
    1.12 +FIND_LIBRARY(CPLEX_LIBRARY
    1.13 +  cplex91
    1.14 +  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    1.15 +  PATHS "/opt/ilog/cplex91/bin"
    1.16 +  HINTS ${CPLEX_ROOT_DIR}/bin
    1.17 +)
    1.18 +
    1.19 +INCLUDE(FindPackageHandleStandardArgs)
    1.20 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    1.21 +
    1.22 +FIND_PATH(CPLEX_BIN_DIR
    1.23 +  cplex91.dll
    1.24 +  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
    1.25 +)
    1.26 +
    1.27 +IF(CPLEX_FOUND)
    1.28 +  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    1.29 +  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    1.30 +  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    1.31 +    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    1.32 +  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    1.33 +ENDIF(CPLEX_FOUND)
    1.34 +
    1.35 +MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    1.36 +
    1.37 +IF(CPLEX_FOUND)
    1.38 +  SET(LEMON_HAVE_LP TRUE)
    1.39 +  SET(LEMON_HAVE_MIP TRUE)
    1.40 +  SET(LEMON_HAVE_CPLEX TRUE)
    1.41 +ENDIF(CPLEX_FOUND)