cmake/FindCOIN.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Tue, 20 Dec 2011 19:33:51 +0100
changeset 1113 53c0dd387001
parent 1062 1f1328691a07
child 1120 ee581a0ecfbf
permissions -rw-r--r--
Support shared library build (#433)
ladanyi@668
     1
SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
ladanyi@668
     2
ladanyi@668
     3
FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
ladanyi@681
     4
  HINTS ${COIN_ROOT_DIR}/include
ladanyi@681
     5
)
ladanyi@681
     6
FIND_LIBRARY(COIN_CBC_LIBRARY
ladanyi@681
     7
  NAMES Cbc libCbc
alpar@1062
     8
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
     9
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    10
)
ladanyi@681
    11
FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
ladanyi@681
    12
  NAMES CbcSolver libCbcSolver
alpar@1062
    13
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    14
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    15
)
ladanyi@681
    16
FIND_LIBRARY(COIN_CGL_LIBRARY
ladanyi@681
    17
  NAMES Cgl libCgl
alpar@1062
    18
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    19
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    20
)
ladanyi@681
    21
FIND_LIBRARY(COIN_CLP_LIBRARY
ladanyi@681
    22
  NAMES Clp libClp
alpar@1062
    23
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    24
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    25
)
ladanyi@681
    26
FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
ladanyi@681
    27
  NAMES CoinUtils libCoinUtils
alpar@1062
    28
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    29
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    30
)
ladanyi@681
    31
FIND_LIBRARY(COIN_OSI_LIBRARY
ladanyi@681
    32
  NAMES Osi libOsi
alpar@1062
    33
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    34
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    35
)
ladanyi@681
    36
FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
ladanyi@681
    37
  NAMES OsiCbc libOsiCbc
alpar@1062
    38
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    39
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    40
)
ladanyi@681
    41
FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
ladanyi@681
    42
  NAMES OsiClp libOsiClp
alpar@1062
    43
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    44
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    45
)
ladanyi@681
    46
FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
ladanyi@681
    47
  NAMES OsiVol libOsiVol
alpar@1062
    48
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    49
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    50
)
ladanyi@681
    51
FIND_LIBRARY(COIN_VOL_LIBRARY
ladanyi@681
    52
  NAMES Vol libVol
alpar@1062
    53
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@681
    54
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@681
    55
)
ladanyi@668
    56
ladanyi@668
    57
INCLUDE(FindPackageHandleStandardArgs)
ladanyi@668
    58
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
ladanyi@668
    59
  COIN_INCLUDE_DIR
ladanyi@668
    60
  COIN_CBC_LIBRARY
ladanyi@668
    61
  COIN_CBC_SOLVER_LIBRARY
ladanyi@668
    62
  COIN_CGL_LIBRARY
ladanyi@668
    63
  COIN_CLP_LIBRARY
ladanyi@668
    64
  COIN_COIN_UTILS_LIBRARY
ladanyi@668
    65
  COIN_OSI_LIBRARY
ladanyi@668
    66
  COIN_OSI_CBC_LIBRARY
ladanyi@668
    67
  COIN_OSI_CLP_LIBRARY
alpar@1063
    68
  # COIN_OSI_VOL_LIBRARY
alpar@1063
    69
  # COIN_VOL_LIBRARY
ladanyi@668
    70
)
ladanyi@668
    71
ladanyi@668
    72
IF(COIN_FOUND)
ladanyi@668
    73
  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
alpar@1063
    74
  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}")
ladanyi@668
    75
  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
ladanyi@668
    76
  SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
ladanyi@668
    77
ENDIF(COIN_FOUND)
ladanyi@668
    78
ladanyi@668
    79
MARK_AS_ADVANCED(
ladanyi@668
    80
  COIN_INCLUDE_DIR
ladanyi@668
    81
  COIN_CBC_LIBRARY
ladanyi@668
    82
  COIN_CBC_SOLVER_LIBRARY
ladanyi@668
    83
  COIN_CGL_LIBRARY
ladanyi@668
    84
  COIN_CLP_LIBRARY
ladanyi@668
    85
  COIN_COIN_UTILS_LIBRARY
ladanyi@668
    86
  COIN_OSI_LIBRARY
ladanyi@668
    87
  COIN_OSI_CBC_LIBRARY
ladanyi@668
    88
  COIN_OSI_CLP_LIBRARY
ladanyi@668
    89
  COIN_OSI_VOL_LIBRARY
ladanyi@668
    90
  COIN_VOL_LIBRARY
ladanyi@668
    91
)
ladanyi@668
    92
ladanyi@668
    93
IF(COIN_FOUND)
ladanyi@674
    94
  SET(LEMON_HAVE_LP TRUE)
ladanyi@674
    95
  SET(LEMON_HAVE_MIP TRUE)
ladanyi@674
    96
  SET(LEMON_HAVE_CLP TRUE)
ladanyi@674
    97
  SET(LEMON_HAVE_CBC TRUE)
ladanyi@668
    98
ENDIF(COIN_FOUND)