cmake/FindILOG.cmake
changeset 1402 3c00344f49c9
parent 1232 fc3854d936f7
child 1427 57abff252556
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cmake/FindILOG.cmake	Wed Oct 17 19:14:07 2018 +0200
     1.3 @@ -0,0 +1,106 @@
     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/x86_linux/static_pic
    1.69 +  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_linux/static_pic
    1.70 +  ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
    1.71 +  NO_DEFAULT_PATH
    1.72 +  )
    1.73 +
    1.74 +FIND_LIBRARY(ILOG_CONCERT_LIBRARY
    1.75 +  concert
    1.76 +  HINTS ${ILOG_CONCERT_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
    1.77 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
    1.78 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
    1.79 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
    1.80 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_linux/static_pic
    1.81 +  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_linux/static_pic
    1.82 +  ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
    1.83 +  NO_DEFAULT_PATH
    1.84 +  )
    1.85 +
    1.86 +FIND_FILE(ILOG_CPLEX_DLL
    1.87 +  cplex121.dll cplex122.dll cplex123.dll cplex124.dll
    1.88 +  HINTS ${ILOG_CPLEX_ROOT_DIR}/bin/${ILOG_WIN_PLATFORM}
    1.89 +  NO_DEFAULT_PATH
    1.90 +  )
    1.91 +
    1.92 +INCLUDE(FindPackageHandleStandardArgs)
    1.93 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ILOG
    1.94 +  DEFAULT_MSG ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR
    1.95 +  )
    1.96 +
    1.97 +IF(ILOG_FOUND)
    1.98 +  SET(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR})
    1.99 +  SET(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY})
   1.100 +  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
   1.101 +    # SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
   1.102 +    SET(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread")
   1.103 +  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
   1.104 +ENDIF(ILOG_FOUND)
   1.105 +
   1.106 +MARK_AS_ADVANCED(
   1.107 +  ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR ILOG_CPLEX_DLL
   1.108 +  ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL
   1.109 +  )