File: FindODBC.cmake

package info (click to toggle)
pvpgn 1.99.7.2.1%2Bdfsg-3
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 8,300 kB
  • sloc: cpp: 118,407; xml: 6,367; sh: 1,558; ansic: 1,300; perl: 604; cs: 382; python: 308; php: 130; awk: 73; makefile: 19
file content (58 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 
# Find the ODBC driver manager includes and library.
# 
# 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.
#  
# 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 FALSE)

find_path(ODBC_INCLUDE_DIR sql.h
  /usr/include
  /usr/include/odbc
  /usr/local/include
  /usr/local/include/odbc
  /usr/local/odbc/include
  "C:/Program Files/ODBC/include"
  "C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" 
  "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" 
  "C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" 
  "C:/ODBC/include"
  DOC "Specify the directory containing sql.h."
)

find_library(ODBC_LIBRARY 
  NAMES iodbc odbc odbcinst odbc32
  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"
  "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib"
  "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
  DOC "Specify the ODBC driver manager library here."
)

if(ODBC_LIBRARY)
  if(ODBC_INCLUDE_DIR)
    set( ODBC_FOUND 1 )
  endif()
endif()

set(ODBC_LIBRARIES ${ODBC_LIBRARY})

mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIR)