FindGUROBI.cmake 1.71 KB
Newer Older
David Bommes's avatar
David Bommes committed
1
2
3
4
5
6
7
8
9
if (GUROBI_INCLUDE_DIR)
  # in cache already
  set(GUROBI_FOUND TRUE)
else (GUROBI_INCLUDE_DIR)

if (WIN32)
   find_path(GUROBI_INCLUDE_DIR NAMES gurobi_c++.h
     PREFIXES SRC
     PATHS
David Bommes's avatar
David Bommes committed
10
     "C:\\libs\\gurobi45"
David Bommes's avatar
David Bommes committed
11
12
13
14
15
     ${GUROBI_INCLUDE_PATH}
   )

   find_library( GUROBI_LIBRARY_RELEASE 
                 SuperLU
David Bommes's avatar
David Bommes committed
16
                 PATHS "C:\\libs\\gurobi45\\lib" )
David Bommes's avatar
David Bommes committed
17
18
   find_library( GUROBI_LIBRARY_DEBUG
                   SuperLUd
David Bommes's avatar
David Bommes committed
19
                   PATHS "C:\\libs\\gurobi45\\lib" )
David Bommes's avatar
David Bommes committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


   set ( GUROBI_LIBRARY "optimized;${GUROBI_LIBRARY_RELEASE};debug;${GUROBI_LIBRARY_DEBUG}" CACHE  STRING "GUROBI Libraries" )

ELSEIF(APPLE)

   find_path(GUROBI_INCLUDE_DIR NAMES gurobi_c++.h
	     PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
	     	   ${GUROBI_INCLUDE_PATH}
            )

   find_library( GUROBI_LIBRARY 
                 SuperLU
                 PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40")

ELSE( WIN32 )
   find_path(GUROBI_INCLUDE_DIR NAMES gurobi_c++.h
     PATHS "$ENV{GUROBI_HOME}/include"
     ${GUROBI_INCLUDE_PATH}
   )

#   MESSAGE(STATUS "$ENV{GUROBI_HOME}/include")
   IF(GUROBI_INCLUDE_DIR)
      SET(GUROBI_FOUND TRUE)
      SET(GUROBI_INCLUDE_DIR ${GUROBI_INCLUDE_DIR})
      SET(GUROBI_LIBRARY_DIR "$ENV{GUROBI_HOME}/lib/" CACHE PATH "Path to GUROBI Library")
David Bommes's avatar
David Bommes committed
46
      SET(GUROBI_LIBRARY "gurobi45;gurobi_c++;pthread" CACHE STRING "GUROBI Libraries")  
David Bommes's avatar
David Bommes committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
      MESSAGE(STATUS "${GUROBI_LIBRARY_DIR}")
      MESSAGE(STATUS "${GUROBI_LIBRARY}")
    ELSE(GUROBI_INCLUDE_DIR)
      SET(GUROBI_FOUND FALSE)
      SET(GUROBI_INCLUDE_DIR ${GUROBI_INCLUDE_DIR})
    ENDIF(GUROBI_INCLUDE_DIR)

   #find_library( GUROBI_LIBRARY 
    #             gurobi
     #            PATHS "${GUROBI_HOME}/lib" )
ENDIF()


endif(GUROBI_INCLUDE_DIR)