You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.7 KiB

  1. #### Taken from http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindGUROBI.cmake
  2. #### This file needs to be updated regularly to include new Gurobi releases.
  3. #### Also update the error message in the Gurobi section of ../resources/CMakeLists.txt
  4. # - Try to find GUROBI
  5. # Once done this will define
  6. # GUROBI_FOUND - System has Gurobi
  7. # GUROBI_INCLUDE_DIRS - The Gurobi include directories
  8. # GUROBI_LIBRARIES - The libraries needed to use Gurobi
  9. if (GUROBI_INCLUDE_DIR)
  10. # in cache already
  11. set(GUROBI_FOUND TRUE)
  12. set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
  13. set(GUROBI_LIBRARIES "${GUROBI_LIBRARY};${GUROBI_CXX_LIBRARY}" )
  14. else (GUROBI_INCLUDE_DIR)
  15. find_path(GUROBI_INCLUDE_DIR
  16. NAMES gurobi_c++.h
  17. PATHS "$ENV{GUROBI_HOME}/include"
  18. "/Library/gurobi502/mac64/include"
  19. "/Library/gurobi602/mac64/include"
  20. "/Library/gurobi604/mac64/include"
  21. "/Library/gurobi605/mac64/include"
  22. "/Library/gurobi650/mac64/include"
  23. "/Library/gurobi651/mac64/include"
  24. "/Library/gurobi652/mac64/include"
  25. "/Library/gurobi702/mac64/include"
  26. "/Library/gurobi801/mac64/include"
  27. "/Library/gurobi810/mac64/include"
  28. "/Library/gurobi900/mac64/include"
  29. "${GUROBI_ROOT}/include"
  30. )
  31. find_library( GUROBI_LIBRARY
  32. NAMES gurobi
  33. gurobi45
  34. gurobi46
  35. gurobi50
  36. gurobi51
  37. gurobi52
  38. gurobi55
  39. gurobi56
  40. gurobi60
  41. gurobi65
  42. gurobi70
  43. gurobi75
  44. gurobi80
  45. gurobi81
  46. gurobi90
  47. PATHS "$ENV{GUROBI_HOME}/lib"
  48. "/Library/gurobi502/mac64/lib"
  49. "/Library/gurobi602/mac64/lib"
  50. "/Library/gurobi604/mac64/lib"
  51. "/Library/gurobi605/mac64/lib"
  52. "/Library/gurobi650/mac64/lib"
  53. "/Library/gurobi651/mac64/lib"
  54. "/Library/gurobi652/mac64/lib"
  55. "/Library/gurobi702/mac64/lib"
  56. "/Library/gurobi801/mac64/lib"
  57. "/Library/gurobi810/mac64/lib"
  58. "/Library/gurobi811/mac64/lib"
  59. "/Library/gurobi900/mac64/lib"
  60. "${GUROBI_ROOT}/lib"
  61. )
  62. find_library( GUROBI_CXX_LIBRARY
  63. NAMES gurobi_c++
  64. PATHS "$ENV{GUROBI_HOME}/lib"
  65. "/Library/gurobi502/mac64/lib"
  66. "/Library/gurobi602/mac64/lib"
  67. "/Library/gurobi604/mac64/lib"
  68. "/Library/gurobi605/mac64/lib"
  69. "/Library/gurobi650/mac64/lib"
  70. "/Library/gurobi651/mac64/lib"
  71. "/Library/gurobi652/mac64/lib"
  72. "/Library/gurobi702/mac64/lib"
  73. "/Library/gurobi801/mac64/lib"
  74. "/Library/gurobi810/mac64/lib"
  75. "/Library/gurobi900/mac64/lib"
  76. "${GUROBI_ROOT}/lib"
  77. )
  78. set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
  79. set(GUROBI_LIBRARIES "${GUROBI_LIBRARY};${GUROBI_CXX_LIBRARY}" )
  80. # use c++ headers as default
  81. # set(GUROBI_COMPILER_FLAGS "-DIL_STD" CACHE STRING "Gurobi Compiler Flags")
  82. include(FindPackageHandleStandardArgs)
  83. # handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
  84. # if all listed variables are TRUE
  85. find_package_handle_standard_args(GUROBI DEFAULT_MSG
  86. GUROBI_LIBRARY GUROBI_CXX_LIBRARY GUROBI_INCLUDE_DIR)
  87. mark_as_advanced(GUROBI_INCLUDE_DIR GUROBI_LIBRARY GUROBI_CXX_LIBRARY)
  88. endif(GUROBI_INCLUDE_DIR)