forked from opencog/opencog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindUnixODBC.cmake
54 lines (48 loc) · 1.61 KB
/
FindUnixODBC.cmake
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
# Copyright (c) 2008, OpenCog.org (http://opencog.org)
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# - Try to find the UnixODBC library; Once done this will define
#
# UnixODBC_FOUND - system has the UnixODBC library
# UnixODBC_INCLUDE_DIRS - the UnixODBC include directory
# UnixODBC_LIBRARIES - The libraries needed to use UnixODBC
# Look for the header file
FIND_PATH(UnixODBC_INCLUDE_DIR uodbc_stats.h
/usr/include
/usr/local/include
/usr/include/odbc
/usr/local/include/odbc
/usr/include/libodbc
/usr/local/include/libodbc
)
# Look for the library
FIND_LIBRARY(UnixODBC_LIBRARY
NAMES
odbc
PATHS
/usr/lib
/usr/local/lib)
# Copy the results to the output variables.
IF (UnixODBC_INCLUDE_DIR AND UnixODBC_LIBRARY)
SET(UnixODBC_FOUND 1)
SET(UnixODBC_LIBRARIES ${UnixODBC_LIBRARY})
SET(UnixODBC_INCLUDE_DIRS ${UnixODBC_INCLUDE_DIR})
ELSE (UnixODBC_INCLUDE_DIR AND UnixODBC_LIBRARY)
SET(UnixODBC_FOUND 0)
SET(UnixODBC_LIBRARIES)
SET(UnixODBC_INCLUDE_DIRS)
ENDIF (UnixODBC_INCLUDE_DIR AND UnixODBC_LIBRARY)
# Report the results.
IF (NOT UnixODBC_FOUND)
SET(UnixODBC_DIR_MESSAGE "UnixODBC was not found. Make sure UnixODBC_LIBRARY and UnixODBC_INCLUDE_DIR are set.")
IF (NOT UnixODBC_FIND_QUIETLY)
MESSAGE(STATUS "${UnixODBC_DIR_MESSAGE}")
ELSE (NOT UnixODBC_FIND_QUIETLY)
IF (UnixODBC_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${UnixODBC_DIR_MESSAGE}")
ENDIF (UnixODBC_FIND_REQUIRED)
ENDIF (NOT UnixODBC_FIND_QUIETLY)
ENDIF (NOT UnixODBC_FOUND)
MARK_AS_ADVANCED(UnixODBC_INCLUDE_DIRS)
MARK_AS_ADVANCED(UnixODBC_LIBRARIES)