| 1 |
# |
| 2 |
# Find the ODBC driver manager includes and library. |
| 3 |
# |
| 4 |
# ODBC is an open standard for connecting to different databases in a |
| 5 |
# semi-vendor-independent fashion. First you install the ODBC driver |
| 6 |
# manager. Then you need a driver for each separate database you want |
| 7 |
# to connect to (unless a generic one works). VTK includes neither |
| 8 |
# the driver manager nor the vendor-specific drivers: you have to find |
| 9 |
# those yourself. |
| 10 |
# |
| 11 |
# This module defines |
| 12 |
# ODBC_INCLUDE_DIRECTORIES, where to find sql.h |
| 13 |
# ODBC_LIBRARIES, the libraries to link against to use ODBC |
| 14 |
# ODBC_FOUND. If false, you cannot build anything that requires MySQL. |
| 15 |
|
| 16 |
# also defined, but not for general use is |
| 17 |
# ODBC_LIBRARY, where to find the ODBC driver manager library. |
| 18 |
|
| 19 |
set(ODBC_FOUND FALSE) |
| 20 |
|
| 21 |
find_path(ODBC_INCLUDE_DIR sql.h |
| 22 |
/usr/include |
| 23 |
/usr/include/odbc |
| 24 |
/usr/local/include |
| 25 |
/usr/local/include/odbc |
| 26 |
/usr/local/odbc/include |
| 27 |
"C:/Program Files/ODBC/include" |
| 28 |
"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" |
| 29 |
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" |
| 30 |
"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" |
| 31 |
"C:/ODBC/include" |
| 32 |
DOC "Specify the directory containing sql.h." |
| 33 |
) |
| 34 |
|
| 35 |
find_library(ODBC_LIBRARY |
| 36 |
NAMES iodbc odbc odbcinst odbc32 |
| 37 |
PATHS |
| 38 |
/usr/lib |
| 39 |
/usr/lib/odbc |
| 40 |
/usr/local/lib |
| 41 |
/usr/local/lib/odbc |
| 42 |
/usr/local/odbc/lib |
| 43 |
"C:/Program Files/ODBC/lib" |
| 44 |
"C:/ODBC/lib/debug" |
| 45 |
"C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" |
| 46 |
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" |
| 47 |
DOC "Specify the ODBC driver manager library here." |
| 48 |
) |
| 49 |
|
| 50 |
if(ODBC_LIBRARY) |
| 51 |
if(ODBC_INCLUDE_DIR) |
| 52 |
set( ODBC_FOUND 1 ) |
| 53 |
endif() |
| 54 |
endif() |
| 55 |
|
| 56 |
set(ODBC_LIBRARIES ${ODBC_LIBRARY}) |
| 57 |
|
| 58 |
mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIR) |