diff options
Diffstat (limited to 'storage/connect/CMakeLists.txt')
-rw-r--r-- | storage/connect/CMakeLists.txt | 82 |
1 files changed, 50 insertions, 32 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 2fabd12dcd0..a1594f8797c 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -245,7 +245,7 @@ int main() { ENDIF(CONNECT_WITH_ODBC) # -# JDBC and MongoDB Java Driver +# JDBC with MongoDB Java Driver included but disabled # OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) @@ -265,13 +265,13 @@ IF(CONNECT_WITH_JDBC) MysqlInterface.java OracleInterface.java PostgresqlInterface.java JavaWrappers.jar) add_definitions(-DJDBC_SUPPORT) - IF(CONNECT_WITH_MONGO) + IF(CONNECT_WITH_MONGO) SET(CONNECT_SOURCES ${CONNECT_SOURCES} jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp jmgfam.h jmgoconn.h mongo.h tabjmg.h Mongo2Interface.java Mongo3Interface.java) - add_definitions(-DMONGO_SUPPORT) - ENDIF() + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=0) + ENDIF() ELSE() SET(JDBC_LIBRARY "") ENDIF() @@ -290,33 +290,36 @@ IF(CONNECT_WITH_ZIP) ENDIF(CONNECT_WITH_ZIP) # -# MONGO C Driver (CMAKE NOT YET WORKING) +# MONGO C Driver # -#IF(CONNECT_WITH_MONGO) -# IF(WIN32) -# # Adding some typical places to search in -# SET(PC_MONGO_INCLUDE_DIRS -# C:/mongo-c-driver/include -# D:/mongo-c-driver/include) -# SET(PC_MONGO_LIBRARY_DIRS -# C:/mongo-c-driver/lib -# D:/mongo-c-driver/lib) -# ENDIF(WIN32) -# FIND_PACKAGE(libmongoc 1.7) -# IF (MONGO_FOUND) -# INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR}) -# SET(MONGO_LIBRARY ${MONGO_LIBRARIES}) -# SET(CONNECT_SOURCES ${CONNECT_SOURCES} -# cmgoconn.cpp cmgfam.cpp tabcmg.cpp -# cmgoconn.h cmgfam.h tabcmg.h) -# add_definitions(-DCMGO_SUPPORT) -# IF (NOT JAVA_FOUND AND JNI_FOUND) -# SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h) -# add_definitions(-DMONGO_SUPPORT) -# ENDIF (NOT JAVA_FOUND AND JNI_FOUND) -# ENDIF(MONGO_FOUND) -#ENDIF(CONNECT_WITH_MONGO) +IF(CONNECT_WITH_MONGO) + IF(WIN32) + # Adding some typical places to search in + SET(PC_MONGO_INCLUDE_DIRS + C:/mongo-c-driver/include + D:/mongo-c-driver/include) + SET(PC_MONGO_LIBRARY_DIRS + C:/mongo-c-driver/lib + D:/mongo-c-driver/lib) + ENDIF(WIN32) + FIND_PACKAGE(libmongoc-1.0 1.7) + IF (libmongoc-1.0_FOUND) + INCLUDE_DIRECTORIES(${MONGOC_INCLUDE_DIRS}) + SET(MONGOC_LIBRARY ${MONGOC_LIBRARIES}) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} + cmgoconn.cpp cmgfam.cpp tabcmg.cpp + cmgoconn.h cmgfam.h tabcmg.h) + add_definitions(-DCMGO_SUPPORT) + IF (NOT JAVA_FOUND AND JNI_FOUND) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h) + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=1) + ELSE () + remove_definitions(-DMONGO_ENABLED=0) + add_definitions(-DMONGO_ENABLED=1) + ENDIF (NOT JAVA_FOUND AND JNI_FOUND) + ENDIF(libmongoc-1.0_FOUND) +ENDIF(CONNECT_WITH_MONGO) # @@ -337,9 +340,25 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES} STORAGE_ENGINE COMPONENT connect-engine RECOMPILE_FOR_EMBEDDED -# LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} $(MONGO_LIBRARY) LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} - ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}) + ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY}) + +IF(NOT TARGET connect) + RETURN() +ENDIF() + +# Install some extra files that belong to connect engine +IF(WIN32) + # install ha_connect.lib + GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION) + STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION}) + IF(CMAKE_CONFIGURATION_TYPES) + STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" + CONNECT_LIB ${CONNECT_LIB}) + ENDIF() + INSTALL(FILES ${CONNECT_LIB} + DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) +ENDIF(WIN32) IF(NOT TARGET connect) RETURN() @@ -368,4 +387,3 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND) ${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) ENDIF() - |