cmake/FindCPLEX.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 25 Aug 2010 21:34:58 +0200
changeset 927 16d466589b54
parent 635 89705c452130
child 972 1818cc848005
permissions -rw-r--r--
Backport the CMAKE related changesets from the main branch

[e20fecd1945f] Add check target for CMake (#388)
[e74b5db4f2c6] Put the output of chg-len.py in the version string (#389)
[7d166b8b8018] Safer call of ./scripts/chg-len.py on Windows (#389)
[659ba4805a48] Make CMAKE config more consistent with configure.ac (#390)
[63e4468c680e] Add 'Maintainer' CMAKE build type (#388, #390)
[a725503acfe9] Allow CPACK configuration on all platforms
[10242c611190] Create and install lemon.pc (#393)
[48e29534cf03] The deafult target doesn't build lp_test and mip_test (#388)
[0fbbdd578c06] Full path for DoxygenLayout.xml in Doxyfile.in (#395)
[481496e6d71f] SOURCE_BROWSER Doxygen switch is configurable from CMAKE (#395)
[09282720100b] update-external-tags CMAKE target (#395)
     1 SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
     2 
     3 FIND_PATH(CPLEX_INCLUDE_DIR
     4   ilcplex/cplex.h
     5   PATHS "C:/ILOG/CPLEX91/include"
     6   PATHS "/opt/ilog/cplex91/include"
     7   HINTS ${CPLEX_ROOT_DIR}/include
     8 )
     9 FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex91
    11   PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex91/bin"
    13   HINTS ${CPLEX_ROOT_DIR}/bin
    14 )
    15 
    16 INCLUDE(FindPackageHandleStandardArgs)
    17 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    18 
    19 FIND_PATH(CPLEX_BIN_DIR
    20   cplex91.dll
    21   PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
    22 )
    23 
    24 IF(CPLEX_FOUND)
    25   SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    26   SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    27   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    28     SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    29   ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    30 ENDIF(CPLEX_FOUND)
    31 
    32 MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    33 
    34 IF(CPLEX_FOUND)
    35   SET(LEMON_HAVE_LP TRUE)
    36   SET(LEMON_HAVE_MIP TRUE)
    37   SET(LEMON_HAVE_CPLEX TRUE)
    38 ENDIF(CPLEX_FOUND)