gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Update CPLEX lookup - References to explicit CPLEX version 9.1 have been removed - Library file name must either be 'cplex.a' or 'cplex.dll'
0 2 0
default
2 files changed with 11 insertions and 9 deletions:
↑ Collapse diff ↑
Show white space 192 line context
1 1
SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
2 2

	
3 3
FIND_PATH(CPLEX_INCLUDE_DIR
4 4
  ilcplex/cplex.h
5
  PATHS "C:/ILOG/CPLEX91/include"
6
  PATHS "/opt/ilog/cplex91/include"
5
  PATHS "C:/ILOG/CPLEX/include"
6
  PATHS "/opt/ilog/cplex/include"
7 7
  HINTS ${CPLEX_ROOT_DIR}/include
8 8
)
9 9
FIND_LIBRARY(CPLEX_LIBRARY
10
  cplex91
11
  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
12
  PATHS "/opt/ilog/cplex91/bin"
10
  cplex
11
  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
12
  PATHS "/opt/ilog/cplex/bin"
13 13
  HINTS ${CPLEX_ROOT_DIR}/bin
14
  HINTS ${CPLEX_ROOT_DIR}/lib
14 15
)
15 16

	
16 17
INCLUDE(FindPackageHandleStandardArgs)
17 18
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
18 19

	
19 20
FIND_PATH(CPLEX_BIN_DIR
20
  cplex91.dll
21
  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
21
  cplex.dll
22
  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
23
  HINTS ${CPLEX_ROOT_DIR}/bin
22 24
)
23 25

	
24 26
IF(CPLEX_FOUND)
25 27
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
26 28
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
27 29
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
28 30
    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
29 31
  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
30 32
ENDIF(CPLEX_FOUND)
31 33

	
32 34
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
33 35

	
34 36
IF(CPLEX_FOUND)
35 37
  SET(LEMON_HAVE_LP TRUE)
36 38
  SET(LEMON_HAVE_MIP TRUE)
37 39
  SET(LEMON_HAVE_CPLEX TRUE)
38 40
ENDIF(CPLEX_FOUND)
Show white space 192 line context
1 1
INCLUDE_DIRECTORIES(
2 2
  ${PROJECT_SOURCE_DIR}
3 3
  ${PROJECT_BINARY_DIR}
4 4
)
5 5

	
6 6
LINK_DIRECTORIES(
7 7
  ${PROJECT_BINARY_DIR}/lemon
8 8
)
9 9

	
10 10
SET(TEST_WITH_VALGRIND "NO" CACHE STRING
11 11
  "Run the test with valgrind (YES/NO).")
12 12
SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
13 13

	
14 14
SET(TESTS
15 15
  adaptors_test
16 16
  bfs_test
17 17
  circulation_test
18 18
  connectivity_test
19 19
  counter_test
20 20
  dfs_test
21 21
  digraph_test
22 22
  dijkstra_test
23 23
  dim_test
24 24
  edge_set_test
25 25
  error_test
26 26
  euler_test
27 27
  gomory_hu_test
28 28
  graph_copy_test
29 29
  graph_test
30 30
  graph_utils_test
31 31
  hao_orlin_test
32 32
  heap_test
33 33
  kruskal_test
34 34
  lgf_test
35 35
  maps_test
36 36
  matching_test
37 37
  min_cost_arborescence_test
38 38
  min_cost_flow_test
39 39
  path_test
40 40
  preflow_test
41 41
  radix_sort_test
42 42
  random_test
43 43
  suurballe_test
44 44
  time_measure_test
45 45
  unionfind_test
46 46
)
47 47

	
48 48
IF(LEMON_HAVE_LP)
49 49
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
50 50
    ADD_EXECUTABLE(lp_test lp_test.cc)
51 51
  ELSE()
52 52
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
53 53
  ENDIF()
54 54

	
55 55
  SET(LP_TEST_LIBS lemon)
56 56

	
57 57
  IF(LEMON_HAVE_GLPK)
58 58
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
59 59
  ENDIF()
60 60
  IF(LEMON_HAVE_CPLEX)
61 61
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
62 62
  ENDIF()
63 63
  IF(LEMON_HAVE_CLP)
64 64
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
65 65
  ENDIF()
66 66

	
67 67
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
68 68
  ADD_TEST(lp_test lp_test)
69 69
  ADD_DEPENDENCIES(check lp_test)
70 70

	
71 71
  IF(WIN32 AND LEMON_HAVE_GLPK)
72 72
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
73 73
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
74 74
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
75 75
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
76 76
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
77 77
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
78 78
    )
79 79
  ENDIF()
80 80

	
81 81
  IF(WIN32 AND LEMON_HAVE_CPLEX)
82 82
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
83 83
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
84 84
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
85
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
85
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
86 86
    )
87 87
  ENDIF()
88 88
ENDIF()
89 89

	
90 90
IF(LEMON_HAVE_MIP)
91 91
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
92 92
    ADD_EXECUTABLE(mip_test mip_test.cc)
93 93
  ELSE()
94 94
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
95 95
  ENDIF()
96 96

	
97 97
  SET(MIP_TEST_LIBS lemon)
98 98

	
99 99
  IF(LEMON_HAVE_GLPK)
100 100
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
101 101
  ENDIF()
102 102
  IF(LEMON_HAVE_CPLEX)
103 103
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
104 104
  ENDIF()
105 105
  IF(LEMON_HAVE_CBC)
106 106
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
107 107
  ENDIF()
108 108

	
109 109
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
110 110
  ADD_TEST(mip_test mip_test)
111 111
  ADD_DEPENDENCIES(check mip_test)
112 112

	
113 113
  IF(WIN32 AND LEMON_HAVE_GLPK)
114 114
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
115 115
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
116 116
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
117 117
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
118 118
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
119 119
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
120 120
    )
121 121
  ENDIF()
122 122

	
123 123
  IF(WIN32 AND LEMON_HAVE_CPLEX)
124 124
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
125 125
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
126 126
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
127
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
127
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
128 128
    )
129 129
  ENDIF()
130 130
ENDIF()
131 131

	
132 132
FOREACH(TEST_NAME ${TESTS})
133 133
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
134 134
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
135 135
  ELSE()
136 136
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
137 137
  ENDIF()
138 138
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
139 139
    IF(TEST_WITH_VALGRIND)
140 140
      ADD_TEST(${TEST_NAME}
141 141
        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
142 142
        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
143 143
    ELSE()
144 144
      ADD_TEST(${TEST_NAME} ${TEST_NAME})
145 145
    ENDIF()
146 146
  ADD_DEPENDENCIES(check ${TEST_NAME})
147 147
ENDFOREACH()
0 comments (0 inline)