FindODBC.cmake 1.46 KB
Newer Older
1
#
2
# Find the ODBC driver manager includes and library.
3
#
4 5 6 7 8 9
# ODBC is an open standard for connecting to different databases in a
# semi-vendor-independent fashion.  First you install the ODBC driver
# manager.  Then you need a driver for each separate database you want
# to connect to (unless a generic one works).  VTK includes neither
# the driver manager nor the vendor-specific drivers: you have to find
# those yourself.
10
#
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
# This module defines
# ODBC_INCLUDE_DIRECTORIES, where to find sql.h
# ODBC_LIBRARIES, the libraries to link against to use ODBC
# ODBC_FOUND.  If false, you cannot build anything that requires MySQL.

# also defined, but not for general use is
# ODBC_LIBRARY, where to find the ODBC driver manager library.

SET( ODBC_FOUND 0 )

FIND_PATH(ODBC_INCLUDE_DIRECTORIES sql.h
  /usr/include
  /usr/include/odbc
  /usr/local/include
  /usr/local/include/odbc
  /usr/local/odbc/include
  "C:/Program Files/ODBC/include"
  "C:/ODBC/include"
  DOC "Specify the directory containing sql.h."
)

32
FIND_LIBRARY( ODBC_LIBRARY
33
  NAMES odbc iodbc unixodbc
34 35 36 37 38 39 40 41 42 43 44 45 46 47
  PATHS
  /usr/lib
  /usr/lib/odbc
  /usr/local/lib
  /usr/local/lib/odbc
  /usr/local/odbc/lib
  "C:/Program Files/ODBC/lib"
  "C:/ODBC/lib/debug"
  DOC "Specify the ODBC driver manager library here."
)

IF (ODBC_LIBRARY)
  IF (ODBC_INCLUDE_DIRECTORIES)
    SET( ODBC_FOUND 1 )
48 49
  ENDIF ()
ENDIF ()
50 51 52 53 54

SET( ODBC_LIBRARIES ${ODBC_LIBRARY} )

MARK_AS_ADVANCED( ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES )