mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-24 22:29:47 +01:00
Merge pull request #285 from nocnokneo/check-for-odbc-headers
Check for ODBC headers in addition to checking for odbc_config tool
This commit is contained in:
@@ -5,6 +5,19 @@ find_program(UNIX_ODBC_CONFIG odbc_config
|
|||||||
/usr/local/bin
|
/usr/local/bin
|
||||||
PATHS)
|
PATHS)
|
||||||
|
|
||||||
|
# Check that we can find the ODBC headers in `odbc_config --include-prefix`
|
||||||
|
# location If the headers cannot be found, set UNIX_ODBC_CONFIG to
|
||||||
|
# UNIX_ODBC_CONFIG-NOTFOUND since the odbc_config tool is essentially useless
|
||||||
|
# if `odbc_config --include-prefix` doesn't actually point to ODBC headers
|
||||||
|
if(NOT ${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
||||||
|
execute_process(COMMAND ${UNIX_ODBC_CONFIG} --include-prefix
|
||||||
|
OUTPUT_VARIABLE UNIX_ODBC_INCLUDE_PREFIX
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT EXISTS ${UNIX_ODBC_INCLUDE_PREFIX}/sqlext.h)
|
||||||
|
set(UNIX_ODBC_CONFIG "UNIX_ODBC_CONFIG-NOTFOUND")
|
||||||
|
endif(NOT EXISTS ${UNIX_ODBC_INCLUDE_PREFIX}/sqlext.h)
|
||||||
|
endif(NOT ${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
||||||
|
|
||||||
if(${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
if(${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
||||||
message(STATUS "Couldn't find unixODBC")
|
message(STATUS "Couldn't find unixODBC")
|
||||||
else(${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
else(${UNIX_ODBC_CONFIG} MATCHES "UNIX_ODBC_CONFIG-NOTFOUND")
|
||||||
|
|||||||
Reference in New Issue
Block a user