Commit 6690bafc authored by Alexander Barkov's avatar Alexander Barkov

Adding a possibility to disable ODBC, XML and MySQL support in CONNECT:

cmake . -DCONNECT_WITH_ODBC=0 -DCONNECT_WITH_XML=0 -DCONNECT_WITH_MYSQL=0

modified:
  storage/connect/CMakeLists.txt
parent ba82edd4
......@@ -24,7 +24,7 @@ colblk.cpp reldef.cpp tabcol.cpp table.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp
tabdos.cpp tabfix.cpp tabfmt.cpp tabmul.cpp tabsys.cpp tabvct.cpp
valblk.cpp value.cpp xindex.cpp xobject.cpp
filamzip.cpp tabtbl.cpp myconn.cpp myutil.cpp tabmysql.cpp)
filamzip.cpp tabtbl.cpp myutil.cpp)
#
......@@ -64,103 +64,118 @@ ENDIF(UNIX)
# XML
#
IF(WIN32)
# Adding some typical places to search in
SET(PC_LIBXML_INCLUDE_DIRS
C:/libxml2/include
C:/libxml/include
D:/libxml/include)
SET(PC_LIBXML_LIBRARY_DIRS
C:/libxml2/lib
C:/libxml/lib
D:/libxml/lib)
ENDIF(WIN32)
FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabxml.cpp plgxml.cpp libdoc.cpp)
add_definitions(-DXML_SUPPORT)
OPTION(CONNECT_WITH_XML "Compile CONNECT storage engine with XML support" ON)
IF(CONNECT_WITH_XML)
IF(WIN32)
# Domdoc support. TODO: add msxml4.dll detection.
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp)
add_definitions(-DDOMDOC_SUPPORT)
# Adding some typical places to search in
SET(PC_LIBXML_INCLUDE_DIRS
C:/libxml2/include
C:/libxml/include
D:/libxml/include)
SET(PC_LIBXML_LIBRARY_DIRS
C:/libxml2/lib
C:/libxml/lib
D:/libxml/lib)
ENDIF(WIN32)
ENDIF(LIBXML2_FOUND)
FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabxml.cpp plgxml.cpp libdoc.cpp)
add_definitions(-DXML_SUPPORT)
IF(WIN32)
# Domdoc support. TODO: add msxml4.dll detection.
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp)
add_definitions(-DDOMDOC_SUPPORT)
ENDIF(WIN32)
ENDIF(LIBXML2_FOUND)
ENDIF(CONNECT_WITH_XML)
#
# MySQL
#
# For static linking
SET(MYSQL_LIBRARY mysqlclient)
# For dynamic linking
#SET(MYSQL_LIBRARY libmysql)
add_definitions(-DMYSQL_SUPPORT)
IF(!UNIX)
#
# TODO: remove this
# change to use "#include "../../include/mysql.h" in the sources.
INCLUDE_DIRECTORIES("../../include/mysql")
ENDIF(!UNIX)
OPTION(CONNECT_WITH_MYSQL
"Compile CONNECT storage engine with remote MySQL connection support"
ON)
IF(CONNECT_WITH_MYSQL)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} myconn.cpp tabmysql.cpp)
# For static linking
SET(MYSQL_LIBRARY mysqlclient)
# For dynamic linking
#SET(MYSQL_LIBRARY libmysql)
add_definitions(-DMYSQL_SUPPORT)
IF(!UNIX)
#
# TODO: remove this
# change to use "#include "../../include/mysql.h" in the sources.
INCLUDE_DIRECTORIES("../../include/mysql")
ENDIF(!UNIX)
ENDIF(CONNECT_WITH_MYSQL)
#
# ODBC
#
if(UNIX)
# Note, we currently detect unixODBC only on Linux.
# TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in
# find_library does not work on machines with both unixODBC and iODBC
# installed, because it finds headers from unixODBC while libraries
# from iODBC. We could search for 'isql.h' instead of 'sql.h' so
# the library 'libodbc' gets compiled with 'isql.h' and
# the library 'libiodbc' gets compiled with 'sql'h.
# This will also need changes in the sources (e.g. #include <isql.h>).
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/Microsoft SDKs/Windows/v6.0a/include"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include"
DOC "Specify the directory containing sql.h."
)
find_library(ODBC_LIBRARY
NAMES 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/Microsoft SDKs/Windows/v6.0A/Lib"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
DOC "Specify the ODBC driver manager library here."
)
IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY)
INCLUDE_DIRECTORIES(${ODBC_INCLUDE_DIR})
OPTION(CONNECT_WITH_ODBC "Compile CONNECT storage engine with ODBC support" ON)
IF(CONNECT_WITH_ODBC)
if(UNIX)
# Note, we currently detect unixODBC only on Linux.
# TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in
# find_library does not work on machines with both unixODBC and iODBC
# installed, because it finds headers from unixODBC while libraries
# from iODBC. We could search for 'isql.h' instead of 'sql.h' so
# the library 'libodbc' gets compiled with 'isql.h' and
# the library 'libiodbc' gets compiled with 'sql'h.
# This will also need changes in the sources (e.g. #include <isql.h>).
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/Microsoft SDKs/Windows/v6.0a/include"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include"
DOC "Specify the directory containing sql.h."
)
find_library(ODBC_LIBRARY
NAMES 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/Microsoft SDKs/Windows/v6.0A/Lib"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
DOC "Specify the ODBC driver manager library here."
)
IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY)
INCLUDE_DIRECTORIES(${ODBC_INCLUDE_DIR})
add_definitions(-DODBC_SUPPORT)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp)
ELSE()
SET(ODBC_LIBRARY "")
ENDIF()
ELSE(!UNIX)
add_definitions(-DODBC_SUPPORT)
SET(ODBC_LIBRARY "odbc32.lib odbccp32.lib")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp)
ELSE()
SET(ODBC_LIBRARY "")
ENDIF()
ELSE(!UNIX)
add_definitions(-DODBC_SUPPORT)
SET(ODBC_LIBRARY "odbc32.lib odbccp32.lib")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp)
ENDIF(UNIX)
ENDIF(UNIX)
ENDIF(CONNECT_WITH_ODBC)
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment