cmake/FindCPLEX.cmake
changeset 646 e01957e96c67
parent 635 89705c452130
child 972 1818cc848005
     1.1 --- a/cmake/FindCPLEX.cmake	Wed Apr 29 16:15:29 2009 +0100
     1.2 +++ b/cmake/FindCPLEX.cmake	Wed Apr 29 19:22:14 2009 +0100
     1.3 @@ -1,21 +1,32 @@
     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 -
    1.10 +  PATHS "C:/ILOG/CPLEX91/include"
    1.11 +  PATHS "/opt/ilog/cplex91/include"
    1.12 +  HINTS ${CPLEX_ROOT_DIR}/include
    1.13 +)
    1.14  FIND_LIBRARY(CPLEX_LIBRARY
    1.15 -  NAMES cplex91
    1.16 -  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda")
    1.17 +  cplex91
    1.18 +  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    1.19 +  PATHS "/opt/ilog/cplex91/bin"
    1.20 +  HINTS ${CPLEX_ROOT_DIR}/bin
    1.21 +)
    1.22  
    1.23  INCLUDE(FindPackageHandleStandardArgs)
    1.24  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    1.25  
    1.26  FIND_PATH(CPLEX_BIN_DIR
    1.27    cplex91.dll
    1.28 -  PATHS "C:/ILOG/CPLEX91/bin/x86_win32")
    1.29 +  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
    1.30 +)
    1.31  
    1.32  IF(CPLEX_FOUND)
    1.33    SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    1.34    SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    1.35 +  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    1.36 +    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    1.37 +  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    1.38  ENDIF(CPLEX_FOUND)
    1.39  
    1.40  MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)