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 ...@@ -24,7 +24,7 @@ colblk.cpp reldef.cpp tabcol.cpp table.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp
tabdos.cpp tabfix.cpp tabfmt.cpp tabmul.cpp tabsys.cpp tabvct.cpp tabdos.cpp tabfix.cpp tabfmt.cpp tabmul.cpp tabsys.cpp tabvct.cpp
valblk.cpp value.cpp xindex.cpp xobject.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) ...@@ -64,103 +64,118 @@ ENDIF(UNIX)
# XML # XML
# #
IF(WIN32) OPTION(CONNECT_WITH_XML "Compile CONNECT storage engine with XML support" ON)
# Adding some typical places to search in
SET(PC_LIBXML_INCLUDE_DIRS IF(CONNECT_WITH_XML)
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)
IF(WIN32) IF(WIN32)
# Domdoc support. TODO: add msxml4.dll detection. # Adding some typical places to search in
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp) SET(PC_LIBXML_INCLUDE_DIRS
add_definitions(-DDOMDOC_SUPPORT) 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(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 # MySQL
# #
# For static linking OPTION(CONNECT_WITH_MYSQL
SET(MYSQL_LIBRARY mysqlclient) "Compile CONNECT storage engine with remote MySQL connection support"
# For dynamic linking ON)
#SET(MYSQL_LIBRARY libmysql)
add_definitions(-DMYSQL_SUPPORT) IF(CONNECT_WITH_MYSQL)
IF(!UNIX) SET(CONNECT_SOURCES ${CONNECT_SOURCES} myconn.cpp tabmysql.cpp)
# # For static linking
# TODO: remove this SET(MYSQL_LIBRARY mysqlclient)
# change to use "#include "../../include/mysql.h" in the sources. # For dynamic linking
INCLUDE_DIRECTORIES("../../include/mysql") #SET(MYSQL_LIBRARY libmysql)
ENDIF(!UNIX) 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 # ODBC
# #
if(UNIX) OPTION(CONNECT_WITH_ODBC "Compile CONNECT storage engine with ODBC support" ON)
# Note, we currently detect unixODBC only on Linux.
# TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in IF(CONNECT_WITH_ODBC)
# find_library does not work on machines with both unixODBC and iODBC if(UNIX)
# installed, because it finds headers from unixODBC while libraries # Note, we currently detect unixODBC only on Linux.
# from iODBC. We could search for 'isql.h' instead of 'sql.h' so # TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in
# the library 'libodbc' gets compiled with 'isql.h' and # find_library does not work on machines with both unixODBC and iODBC
# the library 'libiodbc' gets compiled with 'sql'h. # installed, because it finds headers from unixODBC while libraries
# This will also need changes in the sources (e.g. #include <isql.h>). # from iODBC. We could search for 'isql.h' instead of 'sql.h' so
# the library 'libodbc' gets compiled with 'isql.h' and
find_path(ODBC_INCLUDE_DIR sql.h # the library 'libiodbc' gets compiled with 'sql'h.
/usr/include # This will also need changes in the sources (e.g. #include <isql.h>).
/usr/include/odbc
/usr/local/include find_path(ODBC_INCLUDE_DIR sql.h
/usr/local/include/odbc /usr/include
/usr/local/odbc/include /usr/include/odbc
#"C:/Program Files/ODBC/include" /usr/local/include
#"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" /usr/local/include/odbc
#"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" /usr/local/odbc/include
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" #"C:/Program Files/ODBC/include"
DOC "Specify the directory containing sql.h." #"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"
find_library(ODBC_LIBRARY DOC "Specify the directory containing sql.h."
NAMES odbc odbcinst odbc32 )
PATHS
/usr/lib find_library(ODBC_LIBRARY
/usr/lib/odbc NAMES odbc odbcinst odbc32
/usr/local/lib PATHS
/usr/local/lib/odbc /usr/lib
/usr/local/odbc/lib /usr/lib/odbc
#"C:/Program Files/ODBC/lib" /usr/local/lib
#"C:/ODBC/lib/debug" /usr/local/lib/odbc
#"C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" /usr/local/odbc/lib
#"C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" #"C:/Program Files/ODBC/lib"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" #"C:/ODBC/lib/debug"
DOC "Specify the ODBC driver manager library here." #"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"
IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY) DOC "Specify the ODBC driver manager library here."
INCLUDE_DIRECTORIES(${ODBC_INCLUDE_DIR}) )
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) add_definitions(-DODBC_SUPPORT)
SET(ODBC_LIBRARY "odbc32.lib odbccp32.lib")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp) SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp)
ELSE() ENDIF(UNIX)
SET(ODBC_LIBRARY "") ENDIF(CONNECT_WITH_ODBC)
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)
# #
......
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