cmake/FindCOIN.cmake
author Alpar Juttner <alpar@cs.elte.hu>
Tue, 06 Aug 2013 12:04:13 +0200
changeset 980 115031ac8001
parent 920 0dba9b96550a
permissions -rw-r--r--
Further fixes for gcc version 3.3 and 4.3 (#470)
ladanyi@621
     1
SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
ladanyi@621
     2
ladanyi@621
     3
FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
ladanyi@634
     4
  HINTS ${COIN_ROOT_DIR}/include
ladanyi@634
     5
)
ladanyi@634
     6
FIND_LIBRARY(COIN_CBC_LIBRARY
ladanyi@634
     7
  NAMES Cbc libCbc
alpar@919
     8
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
     9
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    10
)
ladanyi@634
    11
FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
ladanyi@634
    12
  NAMES CbcSolver libCbcSolver
alpar@919
    13
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    14
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    15
)
ladanyi@634
    16
FIND_LIBRARY(COIN_CGL_LIBRARY
ladanyi@634
    17
  NAMES Cgl libCgl
alpar@919
    18
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    19
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    20
)
ladanyi@634
    21
FIND_LIBRARY(COIN_CLP_LIBRARY
ladanyi@634
    22
  NAMES Clp libClp
alpar@919
    23
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    24
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    25
)
ladanyi@634
    26
FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
ladanyi@634
    27
  NAMES CoinUtils libCoinUtils
alpar@919
    28
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    29
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    30
)
ladanyi@634
    31
FIND_LIBRARY(COIN_OSI_LIBRARY
ladanyi@634
    32
  NAMES Osi libOsi
alpar@919
    33
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    34
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    35
)
ladanyi@634
    36
FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
ladanyi@634
    37
  NAMES OsiCbc libOsiCbc
alpar@919
    38
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    39
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    40
)
ladanyi@634
    41
FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
ladanyi@634
    42
  NAMES OsiClp libOsiClp
alpar@919
    43
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    44
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    45
)
ladanyi@634
    46
FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
ladanyi@634
    47
  NAMES OsiVol libOsiVol
alpar@919
    48
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    49
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    50
)
ladanyi@634
    51
FIND_LIBRARY(COIN_VOL_LIBRARY
ladanyi@634
    52
  NAMES Vol libVol
alpar@919
    53
  HINTS ${COIN_ROOT_DIR}/lib/coin
ladanyi@634
    54
  HINTS ${COIN_ROOT_DIR}/lib
ladanyi@634
    55
)
ladanyi@621
    56
alpar@951
    57
FIND_LIBRARY(COIN_ZLIB_LIBRARY
alpar@951
    58
  NAMES z libz
alpar@951
    59
  HINTS ${COIN_ROOT_DIR}/lib/coin
alpar@951
    60
  HINTS ${COIN_ROOT_DIR}/lib
alpar@951
    61
)
alpar@951
    62
FIND_LIBRARY(COIN_BZ2_LIBRARY
alpar@951
    63
  NAMES bz2 libbz2
alpar@951
    64
  HINTS ${COIN_ROOT_DIR}/lib/coin
alpar@951
    65
  HINTS ${COIN_ROOT_DIR}/lib
alpar@951
    66
)
alpar@951
    67
ladanyi@621
    68
INCLUDE(FindPackageHandleStandardArgs)
ladanyi@621
    69
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
ladanyi@621
    70
  COIN_INCLUDE_DIR
ladanyi@621
    71
  COIN_CBC_LIBRARY
ladanyi@621
    72
  COIN_CBC_SOLVER_LIBRARY
ladanyi@621
    73
  COIN_CGL_LIBRARY
ladanyi@621
    74
  COIN_CLP_LIBRARY
ladanyi@621
    75
  COIN_COIN_UTILS_LIBRARY
ladanyi@621
    76
  COIN_OSI_LIBRARY
ladanyi@621
    77
  COIN_OSI_CBC_LIBRARY
ladanyi@621
    78
  COIN_OSI_CLP_LIBRARY
alpar@920
    79
  # COIN_OSI_VOL_LIBRARY
alpar@920
    80
  # COIN_VOL_LIBRARY
ladanyi@621
    81
)
ladanyi@621
    82
ladanyi@621
    83
IF(COIN_FOUND)
ladanyi@621
    84
  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
alpar@951
    85
  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
alpar@951
    86
  IF(COIN_ZLIB_LIBRARY)
alpar@951
    87
    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
alpar@951
    88
  ENDIF(COIN_ZLIB_LIBRARY)
alpar@951
    89
   IF(COIN_BZ2_LIBRARY)
alpar@951
    90
    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
alpar@951
    91
  ENDIF(COIN_BZ2_LIBRARY)
alpar@951
    92
  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY};${COIN_CLP_LIBRARIES}")
alpar@951
    93
  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
ladanyi@621
    94
ENDIF(COIN_FOUND)
ladanyi@621
    95
ladanyi@621
    96
MARK_AS_ADVANCED(
ladanyi@621
    97
  COIN_INCLUDE_DIR
ladanyi@621
    98
  COIN_CBC_LIBRARY
ladanyi@621
    99
  COIN_CBC_SOLVER_LIBRARY
ladanyi@621
   100
  COIN_CGL_LIBRARY
ladanyi@621
   101
  COIN_CLP_LIBRARY
ladanyi@621
   102
  COIN_COIN_UTILS_LIBRARY
ladanyi@621
   103
  COIN_OSI_LIBRARY
ladanyi@621
   104
  COIN_OSI_CBC_LIBRARY
ladanyi@621
   105
  COIN_OSI_CLP_LIBRARY
ladanyi@621
   106
  COIN_OSI_VOL_LIBRARY
ladanyi@621
   107
  COIN_VOL_LIBRARY
alpar@951
   108
  COIN_ZLIB_LIBRARY
alpar@951
   109
  COIN_BZ2_LIBRARY
ladanyi@621
   110
)
ladanyi@621
   111
ladanyi@621
   112
IF(COIN_FOUND)
ladanyi@627
   113
  SET(LEMON_HAVE_LP TRUE)
ladanyi@627
   114
  SET(LEMON_HAVE_MIP TRUE)
ladanyi@627
   115
  SET(LEMON_HAVE_CLP TRUE)
ladanyi@627
   116
  SET(LEMON_HAVE_CBC TRUE)
ladanyi@621
   117
ENDIF(COIN_FOUND)