cmake/FindILOG.cmake
changeset 1065 490d89913a17
parent 1062 caf16813b1e8
child 1141 043a787c3cee
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cmake/FindILOG.cmake	Mon Jul 15 08:33:08 2013 +0200
     1.3 @@ -0,0 +1,102 @@
     1.4 +FIND_PATH(ILOG_ROOT_DIR
     1.5 +  NAMES cplex
     1.6 +  DOC "CPLEX STUDIO root directory"
     1.7 +  PATHS /opt/ibm/ILOG /usr/local/ibm/ILOG /usr/local/ILOG /usr/local/ilog
     1.8 +  PATHS "$ENV{HOME}/ILOG" "$ENV{HOME}/.local/ILOG"
     1.9 +  PATHS "$ENV{HOME}/ibm/ILOG" "$ENV{HOME}/.local/ibm/ILOG"
    1.10 +  PATHS "C:/Program Files/IBM/ILOG" 
    1.11 +  PATH_SUFFIXES "CPLEX_Studio126" "CPLEX_Studio125"
    1.12 +  "CPLEX_Studio124" "CPLEX_Studio123" "CPLEX_Studio122"
    1.13 +  NO_DEFAULT_PATH
    1.14 +)
    1.15 +
    1.16 +IF(WIN32)
    1.17 +  IF(MSVC_VERSION STREQUAL "1400")
    1.18 +    SET(ILOG_WIN_COMPILER "windows_vs2005")
    1.19 +  ELSEIF(MSVC_VERSION STREQUAL "1500")
    1.20 +    SET(ILOG_WIN_COMPILER "windows_vs2008")
    1.21 +  ELSEIF(MSVC_VERSION STREQUAL "1600")
    1.22 +    SET(ILOG_WIN_COMPILER "windows_vs2010")
    1.23 +  ELSE()
    1.24 +    SET(ILOG_WIN_COMPILER "windows_vs2008")
    1.25 +  ENDIF()
    1.26 +  IF(CMAKE_CL_64)
    1.27 +    SET(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}")
    1.28 +    SET(ILOG_WIN_PLATFORM "x64_win32")
    1.29 +  ELSE()
    1.30 +    SET(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}")
    1.31 +    SET(ILOG_WIN_PLATFORM "x86_win32")
    1.32 +  ENDIF()
    1.33 +ENDIF()
    1.34 +
    1.35 +FIND_PATH(ILOG_CPLEX_ROOT_DIR
    1.36 +  NAMES include/ilcplex
    1.37 +  HINTS ${ILOG_ROOT_DIR}/cplex ${ILOG_ROOT_DIR}/cplex121
    1.38 +  ${ILOG_ROOT_DIR}/cplex122 ${ILOG_ROOT_DIR}/cplex123
    1.39 +  DOC "CPLEX root directory"
    1.40 +  NO_DEFAULT_PATH
    1.41 +)
    1.42 +
    1.43 +FIND_PATH(ILOG_CONCERT_ROOT_DIR
    1.44 +  NAMES include/ilconcert
    1.45 +  HINTS ${ILOG_ROOT_DIR}/concert ${ILOG_ROOT_DIR}/concert29
    1.46 +  DOC "CONCERT root directory"
    1.47 +  NO_DEFAULT_PATH
    1.48 +)
    1.49 +
    1.50 +FIND_PATH(ILOG_CPLEX_INCLUDE_DIR
    1.51 +  ilcplex/cplex.h
    1.52 +  HINTS ${ILOG_CPLEX_ROOT_DIR}/include
    1.53 +  NO_DEFAULT_PATH
    1.54 +)
    1.55 +
    1.56 +FIND_PATH(ILOG_CONCERT_INCLUDE_DIR
    1.57 +  ilconcert/ilobasic.h
    1.58 +  HINTS ${ILOG_CONCERT_ROOT_DIR}/include
    1.59 +  NO_DEFAULT_PATH
    1.60 +)
    1.61 +
    1.62 +FIND_LIBRARY(ILOG_CPLEX_LIBRARY
    1.63 +  cplex cplex121 cplex122 cplex123 cplex124
    1.64 +  HINTS ${ILOG_CPLEX_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
    1.65 +  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
    1.66 +  ${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
    1.67 +  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
    1.68 +  ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
    1.69 +  NO_DEFAULT_PATH
    1.70 +  )
    1.71 +
    1.72 +FIND_LIBRARY(ILOG_CONCERT_LIBRARY
    1.73 +  concert
    1.74 +  HINTS ${ILOG_CONCERT_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
    1.75 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
    1.76 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
    1.77 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
    1.78 +  ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
    1.79 +  NO_DEFAULT_PATH
    1.80 +  )
    1.81 +
    1.82 +FIND_FILE(ILOG_CPLEX_DLL
    1.83 +  cplex121.dll cplex122.dll cplex123.dll cplex124.dll
    1.84 +  HINTS ${ILOG_CPLEX_ROOT_DIR}/bin/${ILOG_WIN_PLATFORM}
    1.85 +  NO_DEFAULT_PATH
    1.86 +  )
    1.87 +
    1.88 +INCLUDE(FindPackageHandleStandardArgs)
    1.89 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ILOG
    1.90 +  DEFAULT_MSG ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR
    1.91 +  )
    1.92 +
    1.93 +IF(ILOG_FOUND)
    1.94 +  SET(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR})
    1.95 +  SET(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY})
    1.96 +  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    1.97 +    # SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    1.98 +    SET(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread")
    1.99 +  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
   1.100 +ENDIF(ILOG_FOUND)
   1.101 +
   1.102 +MARK_AS_ADVANCED(
   1.103 +  ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR ILOG_CPLEX_DLL
   1.104 +  ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL
   1.105 +  )