COIN-OR::LEMON - Graph Library

source: lemon-main/cmake/FindCOIN.cmake @ 911:481496e6d71f

Last change on this file since 911:481496e6d71f was 634:4629e096e3af, checked in by Akos Ladanyi <ladanyi@…>, 16 years ago

Look for COIN libraries with and without the lib prefix too (#277)

This is necessary because on Windows when built using autotools the COIN
libraries are named in UNIX style, i.e. libCbc.lib insetad of Cbc.lib.

File size: 2.1 KB
Line 
1SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
2
3FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
4  HINTS ${COIN_ROOT_DIR}/include
5)
6FIND_LIBRARY(COIN_CBC_LIBRARY
7  NAMES Cbc libCbc
8  HINTS ${COIN_ROOT_DIR}/lib
9)
10FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
11  NAMES CbcSolver libCbcSolver
12  HINTS ${COIN_ROOT_DIR}/lib
13)
14FIND_LIBRARY(COIN_CGL_LIBRARY
15  NAMES Cgl libCgl
16  HINTS ${COIN_ROOT_DIR}/lib
17)
18FIND_LIBRARY(COIN_CLP_LIBRARY
19  NAMES Clp libClp
20  HINTS ${COIN_ROOT_DIR}/lib
21)
22FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
23  NAMES CoinUtils libCoinUtils
24  HINTS ${COIN_ROOT_DIR}/lib
25)
26FIND_LIBRARY(COIN_OSI_LIBRARY
27  NAMES Osi libOsi
28  HINTS ${COIN_ROOT_DIR}/lib
29)
30FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
31  NAMES OsiCbc libOsiCbc
32  HINTS ${COIN_ROOT_DIR}/lib
33)
34FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
35  NAMES OsiClp libOsiClp
36  HINTS ${COIN_ROOT_DIR}/lib
37)
38FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
39  NAMES OsiVol libOsiVol
40  HINTS ${COIN_ROOT_DIR}/lib
41)
42FIND_LIBRARY(COIN_VOL_LIBRARY
43  NAMES Vol libVol
44  HINTS ${COIN_ROOT_DIR}/lib
45)
46
47INCLUDE(FindPackageHandleStandardArgs)
48FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
49  COIN_INCLUDE_DIR
50  COIN_CBC_LIBRARY
51  COIN_CBC_SOLVER_LIBRARY
52  COIN_CGL_LIBRARY
53  COIN_CLP_LIBRARY
54  COIN_COIN_UTILS_LIBRARY
55  COIN_OSI_LIBRARY
56  COIN_OSI_CBC_LIBRARY
57  COIN_OSI_CLP_LIBRARY
58  COIN_OSI_VOL_LIBRARY
59  COIN_VOL_LIBRARY
60)
61
62IF(COIN_FOUND)
63  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
64  SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_OSI_VOL_LIBRARY};${COIN_VOL_LIBRARY}")
65  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
66  SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
67ENDIF(COIN_FOUND)
68
69MARK_AS_ADVANCED(
70  COIN_INCLUDE_DIR
71  COIN_CBC_LIBRARY
72  COIN_CBC_SOLVER_LIBRARY
73  COIN_CGL_LIBRARY
74  COIN_CLP_LIBRARY
75  COIN_COIN_UTILS_LIBRARY
76  COIN_OSI_LIBRARY
77  COIN_OSI_CBC_LIBRARY
78  COIN_OSI_CLP_LIBRARY
79  COIN_OSI_VOL_LIBRARY
80  COIN_VOL_LIBRARY
81)
82
83IF(COIN_FOUND)
84  SET(LEMON_HAVE_LP TRUE)
85  SET(LEMON_HAVE_MIP TRUE)
86  SET(LEMON_HAVE_CLP TRUE)
87  SET(LEMON_HAVE_CBC TRUE)
88ENDIF(COIN_FOUND)
Note: See TracBrowser for help on using the repository browser.