diff options
Diffstat (limited to 'cmake/plugin.cmake')
-rw-r--r-- | cmake/plugin.cmake | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index e38439f2a21..65e85983d68 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -15,8 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +INCLUDE(CMakeParseArguments) # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN # [STORAGE_ENGINE] @@ -30,9 +29,10 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) # [DEPENDENCIES target1...targetN] MACRO(MYSQL_ADD_PLUGIN) - MYSQL_PARSE_ARGUMENTS(ARG - "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" + CMAKE_PARSE_ARGUMENTS(ARG "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT" + "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" + "LINK_LIBRARIES;DEPENDENCIES" ${ARGN} ) IF(NOT WITHOUT_SERVER OR ARG_CLIENT) @@ -44,8 +44,8 @@ MACRO(MYSQL_ADD_PLUGIN) ${SSL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - LIST(GET ARG_DEFAULT_ARGS 0 plugin) - SET(SOURCES ${ARG_DEFAULT_ARGS}) + LIST(GET ARG_UNPARSED_ARGUMENTS 0 plugin) + SET(SOURCES ${ARG_UNPARSED_ARGUMENTS}) LIST(REMOVE_AT SOURCES 0) STRING(TOUPPER ${plugin} plugin) STRING(TOLOWER ${plugin} target) @@ -213,9 +213,6 @@ MACRO(MYSQL_ADD_PLUGIN) TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined") ENDIF() - IF(ARG_LINK_LIBRARIES) - TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES}) - ENDIF() ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) SET_TARGET_PROPERTIES(${target} PROPERTIES @@ -234,17 +231,21 @@ MACRO(MYSQL_ADD_PLUGIN) SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) IF (NOT ARG_CLIENT) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE) ENDIF() # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) - IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) - SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") - FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") + IF(NOT ARG_CLIENT AND UNIX) + IF (NOT ARG_CONFIG) + SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.cnf") + FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") + ENDIF() INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/plugin-postin.sh PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_POST_TRANS_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-posttrans.sh PARENT_SCOPE) ENDIF() ENDIF() ELSE() |