2016-01-09 23:55:09 +02:00
|
|
|
# - Try to find ODBC
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# ODBC_FOUND - system has ODBC
|
|
|
|
# ODBC_INCLUDES - the ODBC include directory
|
2019-11-25 05:56:32 +00:00
|
|
|
# ODBC_LIBRARIES - the libraries needed to use ODBC
|
2016-01-09 23:55:09 +02:00
|
|
|
#
|
2021-02-05 06:13:36 +02:00
|
|
|
# Copyright (C) 2015, Ivailo Monev, <xakepa10@gmail.com>
|
2016-01-09 23:55:09 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
|
2020-10-26 16:27:43 +02:00
|
|
|
include(FindPkgConfig)
|
2020-12-03 16:33:21 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
2020-10-26 16:27:43 +02:00
|
|
|
pkg_check_modules(PC_ODBC QUIET odbc)
|
|
|
|
if(NOT PC_ODBC_FOUND)
|
|
|
|
pkg_check_modules(PC_ODBC QUIET libiodbc)
|
2019-07-30 12:04:33 +00:00
|
|
|
endif()
|
2016-01-09 23:55:09 +02:00
|
|
|
|
2020-12-01 17:30:43 +00:00
|
|
|
find_path(ODBC_INCLUDES
|
|
|
|
NAMES sql.h
|
|
|
|
PATH_SUFFIXES iodbc libiodbc
|
|
|
|
HINTS $ENV{ODBCDIR}/include ${PC_ODBC_INCLUDEDIR}
|
|
|
|
)
|
2016-01-09 23:55:09 +02:00
|
|
|
|
2020-12-01 17:30:43 +00:00
|
|
|
find_library(ODBC_LIBRARIES
|
|
|
|
NAMES odbc iodbc
|
|
|
|
HINTS $ENV{ODBCDIR}/lib ${PC_ODBC_LIBDIR}
|
|
|
|
)
|
2016-01-09 23:55:09 +02:00
|
|
|
|
2019-07-30 12:04:33 +00:00
|
|
|
find_package_handle_standard_args(ODBC
|
|
|
|
VERSION_VAR PC_ODBC_VERSION
|
2019-12-25 18:29:33 +00:00
|
|
|
REQUIRED_VARS ODBC_LIBRARIES ODBC_INCLUDES
|
2019-07-30 12:04:33 +00:00
|
|
|
)
|
2016-01-09 23:55:09 +02:00
|
|
|
|
|
|
|
mark_as_advanced(ODBC_INCLUDES ODBC_LIBRARIES)
|