From be60b496467d5c62a896646a7c86d9305b8cb3c9 Mon Sep 17 00:00:00 2001 From: benthompson15 Date: Wed, 19 Aug 2020 18:43:46 -0500 Subject: [PATCH] Fix for using correct cnf file when building as submodule. --- dbcon/mysql/CMakeLists.txt | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/dbcon/mysql/CMakeLists.txt b/dbcon/mysql/CMakeLists.txt index 4614ab319..a2e903698 100644 --- a/dbcon/mysql/CMakeLists.txt +++ b/dbcon/mysql/CMakeLists.txt @@ -38,9 +38,18 @@ if (COMMAND mysql_add_plugin) IF(NOT(RPM OR DEB)) SET(disabled DISABLED) ENDIF() + + FILE(COPY columnstore.cnf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/) + if (BUILD_CONFIG STREQUAL "enterprise") + FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/columnstore.cnf ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/x-columnstore.cnf) + SET(CS_CNF_FILE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/x-columnstore.cnf") + else () + SET(CS_CNF_FILE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/columnstore.cnf") + endif () + mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY ${disabled} LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool - COMPONENT columnstore-engine) + COMPONENT columnstore-engine CONFIG ${CS_CNF_FILE}) else () add_library(ha_columnstore SHARED ${libcalmysql_SRCS}) SET_TARGET_PROPERTIES(ha_columnstore PROPERTIES PREFIX "") @@ -53,6 +62,15 @@ else () # define this dummy target for standalone builds (ie, when mysql_add_plugin doesn't exist) add_custom_target(columnstore DEPENDS ha_columnstore) + if(BUILD_CONFIG STREQUAL "enterprise") + message(STATUS "enterprise build: columnstore.cnf renamed to x-columnstore.cnf on install") + install(FILES columnstore.cnf + RENAME x-columnstore.cnf + DESTINATION ${MARIADB_MYCNFDIR} COMPONENT columnstore-engine) + else() + install(FILES columnstore.cnf + DESTINATION ${MARIADB_MYCNFDIR} COMPONENT columnstore-engine) + endif() endif () if (TARGET columnstore) @@ -65,14 +83,4 @@ if (TARGET columnstore) DESTINATION ${ENGINE_SUPPORTDIR} COMPONENT columnstore-engine) install(PROGRAMS install_mcs_mysql.sh DESTINATION ${ENGINE_SBINDIR} COMPONENT columnstore-engine) - - if(BUILD_CONFIG STREQUAL "enterprise") - message(STATUS "enterprise build: columnstore.cnf renamed to x-columnstore.cnf on install") - install(FILES columnstore.cnf - RENAME x-columnstore.cnf - DESTINATION ${MARIADB_MYCNFDIR} COMPONENT columnstore-engine) - else() - install(FILES columnstore.cnf - DESTINATION ${MARIADB_MYCNFDIR} COMPONENT columnstore-engine) - endif() endif()