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,7 +64,10 @@ ENDIF(UNIX) ...@@ -64,7 +64,10 @@ ENDIF(UNIX)
# XML # XML
# #
IF(WIN32) OPTION(CONNECT_WITH_XML "Compile CONNECT storage engine with XML support" ON)
IF(CONNECT_WITH_XML)
IF(WIN32)
# Adding some typical places to search in # Adding some typical places to search in
SET(PC_LIBXML_INCLUDE_DIRS SET(PC_LIBXML_INCLUDE_DIRS
C:/libxml2/include C:/libxml2/include
...@@ -74,9 +77,9 @@ IF(WIN32) ...@@ -74,9 +77,9 @@ IF(WIN32)
C:/libxml2/lib C:/libxml2/lib
C:/libxml/lib C:/libxml/lib
D:/libxml/lib) D:/libxml/lib)
ENDIF(WIN32) ENDIF(WIN32)
FIND_PACKAGE(LibXml2) FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND) IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(XML_LIBRARY ${LIBXML2_LIBRARIES}) SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabxml.cpp plgxml.cpp libdoc.cpp) SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabxml.cpp plgxml.cpp libdoc.cpp)
...@@ -86,31 +89,42 @@ IF (LIBXML2_FOUND) ...@@ -86,31 +89,42 @@ IF (LIBXML2_FOUND)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp) SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp)
add_definitions(-DDOMDOC_SUPPORT) add_definitions(-DDOMDOC_SUPPORT)
ENDIF(WIN32) ENDIF(WIN32)
ENDIF(LIBXML2_FOUND) 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
SET(MYSQL_LIBRARY mysqlclient)
# For dynamic linking
#SET(MYSQL_LIBRARY libmysql)
add_definitions(-DMYSQL_SUPPORT)
IF(!UNIX)
# #
# TODO: remove this # TODO: remove this
# change to use "#include "../../include/mysql.h" in the sources. # change to use "#include "../../include/mysql.h" in the sources.
INCLUDE_DIRECTORIES("../../include/mysql") INCLUDE_DIRECTORIES("../../include/mysql")
ENDIF(!UNIX) ENDIF(!UNIX)
ENDIF(CONNECT_WITH_MYSQL)
# #
# ODBC # ODBC
# #
if(UNIX) 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. # Note, we currently detect unixODBC only on Linux.
# TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in # TODO: detect iODBC as well. Simply adding "iodbc" into NAMES in
# find_library does not work on machines with both unixODBC and iODBC # find_library does not work on machines with both unixODBC and iODBC
...@@ -156,11 +170,12 @@ if(UNIX) ...@@ -156,11 +170,12 @@ if(UNIX)
ELSE() ELSE()
SET(ODBC_LIBRARY "") SET(ODBC_LIBRARY "")
ENDIF() ENDIF()
ELSE(!UNIX) ELSE(!UNIX)
add_definitions(-DODBC_SUPPORT) add_definitions(-DODBC_SUPPORT)
SET(ODBC_LIBRARY "odbc32.lib odbccp32.lib") 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)
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