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.

103 lines
3.8 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/gurobi900/mac64/include"
  19. "/Library/gurobi811/mac64/include"
  20. "/Library/gurobi810/mac64/include"
  21. "/Library/gurobi801/mac64/include"
  22. "/Library/gurobi702/mac64/include"
  23. "/Library/gurobi652/mac64/include"
  24. "/Library/gurobi651/mac64/include"
  25. "/Library/gurobi650/mac64/include"
  26. "/Library/gurobi605/mac64/include"
  27. "/Library/gurobi604/mac64/include"
  28. "/Library/gurobi602/mac64/include"
  29. "/Library/gurobi502/mac64/include"
  30. "${GUROBI_ROOT}/include"
  31. )
  32. find_library( GUROBI_LIBRARY
  33. NAMES gurobi
  34. gurobi90
  35. gurobi81
  36. gurobi80
  37. gurobi75
  38. gurobi70
  39. gurobi65
  40. gurobi60
  41. gurobi56
  42. gurobi55
  43. gurobi52
  44. gurobi51
  45. gurobi50
  46. gurobi46
  47. gurobi45
  48. PATHS "$ENV{GUROBI_HOME}/lib"
  49. "/Library/gurobi900/mac64/lib"
  50. "/Library/gurobi811/mac64/lib"
  51. "/Library/gurobi810/mac64/lib"
  52. "/Library/gurobi801/mac64/lib"
  53. "/Library/gurobi702/mac64/lib"
  54. "/Library/gurobi652/mac64/lib"
  55. "/Library/gurobi651/mac64/lib"
  56. "/Library/gurobi650/mac64/lib"
  57. "/Library/gurobi605/mac64/lib"
  58. "/Library/gurobi604/mac64/lib"
  59. "/Library/gurobi602/mac64/lib"
  60. "/Library/gurobi502/mac64/lib"
  61. "${GUROBI_ROOT}/lib"
  62. )
  63. find_library( GUROBI_CXX_LIBRARY
  64. NAMES gurobi_c++
  65. PATHS "$ENV{GUROBI_HOME}/lib"
  66. "/Library/gurobi900/mac64/lib"
  67. "/Library/gurobi811/mac64/lib"
  68. "/Library/gurobi810/mac64/lib"
  69. "/Library/gurobi801/mac64/lib"
  70. "/Library/gurobi702/mac64/lib"
  71. "/Library/gurobi652/mac64/lib"
  72. "/Library/gurobi651/mac64/lib"
  73. "/Library/gurobi650/mac64/lib"
  74. "/Library/gurobi605/mac64/lib"
  75. "/Library/gurobi604/mac64/lib"
  76. "/Library/gurobi602/mac64/lib"
  77. "/Library/gurobi502/mac64/lib"
  78. "${GUROBI_ROOT}/lib"
  79. )
  80. set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
  81. set(GUROBI_LIBRARIES "${GUROBI_LIBRARY};${GUROBI_CXX_LIBRARY}" )
  82. # use c++ headers as default
  83. # set(GUROBI_COMPILER_FLAGS "-DIL_STD" CACHE STRING "Gurobi Compiler Flags")
  84. include(FindPackageHandleStandardArgs)
  85. # handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
  86. # if all listed variables are TRUE
  87. find_package_handle_standard_args(GUROBI DEFAULT_MSG
  88. GUROBI_LIBRARY GUROBI_CXX_LIBRARY GUROBI_INCLUDE_DIR)
  89. mark_as_advanced(GUROBI_INCLUDE_DIR GUROBI_LIBRARY GUROBI_CXX_LIBRARY)
  90. endif(GUROBI_INCLUDE_DIR)