Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ support-files/mariadb-extra.socket
support-files/mariadb@.service
support-files/mariadb@.socket
support-files/mariadb-extra@.socket
support-files/mariadb-plugin-config.cmake
support-files/mini-benchmark
support-files/my-huge.cnf
support-files/my-innodb-heavy-4G.cnf
Expand Down
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,18 @@ SET(PYTHON_SHEBANG "/usr/bin/env python3" CACHE STRING "python shebang")
MARK_AS_ADVANCED(PYTHON_SHEBANG)

# Add storage engines and plugins.
CONFIGURE_PLUGINS()
IF(NOT WITHOUT_SERVER)
FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
ENDIF()

FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
FOREACH(dir ${dirs_storage} ${dirs_plugin})
IF (EXISTS ${dir}/CMakeLists.txt)
ADD_SUBDIRECTORY(${dir})
ENDIF()
ENDFOREACH()
Comment thread
vuvova marked this conversation as resolved.

VERIFY_PLUGINS()

ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(dbug)
Expand Down
22 changes: 7 additions & 15 deletions cmake/plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

INCLUDE(CMakeParseArguments)

# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
# MARIADB_ADD_PLUGIN(plugin_name source1...sourceN
# [STORAGE_ENGINE]
# [STATIC_ONLY|MODULE_ONLY]
# [MANDATORY|DEFAULT]
Expand All @@ -32,7 +32,7 @@ INCLUDE(CMakeParseArguments)
# [LINK_LIBRARIES lib1...libN]
# [DEPENDS target1...targetN]

MACRO(MYSQL_ADD_PLUGIN)
MACRO(MARIADB_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;VERSION"
Expand Down Expand Up @@ -326,20 +326,12 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDMACRO()


# Add all CMake projects under storage and plugin
# subdirectories, configure sql_builtins.cc
MACRO(CONFIGURE_PLUGINS)
IF(NOT WITHOUT_SERVER)
FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
ENDIF()

FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
FOREACH(dir ${dirs_storage} ${dirs_plugin})
IF (EXISTS ${dir}/CMakeLists.txt)
ADD_SUBDIRECTORY(${dir})
ENDIF()
ENDFOREACH()
MACRO(MYSQL_ADD_PLUGIN)
MARIADB_ADD_PLUGIN(${ARGV})
ENDMACRO()

# verify that all -DPLUGIN_xxx=YES plugins are being built
MACRO(VERIFY_PLUGINS)
GET_CMAKE_PROPERTY(ALL_VARS VARIABLES)
FOREACH (V ${ALL_VARS})
IF (V MATCHES "^PLUGIN_")
Expand Down
6 changes: 6 additions & 0 deletions support-files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,10 @@ IF(UNIX AND NOT WITHOUT_SERVER)
WORKING_DIRECTORY \$ENV{DESTDIR}${prefix})"
COMPONENT SupportFiles)
ENDIF(INSTALL_SYSCONFDIR)

FILE(READ ${CMAKE_SOURCE_DIR}/cmake/install_layout.cmake install_layout.cmake)
FILE(READ ${CMAKE_SOURCE_DIR}/cmake/plugin.cmake plugin.cmake)
CONFIGURE_FILE(mariadb-plugin-config.cmake.in mariadb-plugin-config.cmake @ONLY)
Comment thread
vuvova marked this conversation as resolved.
INSTALL(FILES mariadb-plugin-config.cmake DESTINATION ${INSTALL_SHAREDIR}/cmake/mariadb-plugin/
COMPONENT Development)
ENDIF()
33 changes: 33 additions & 0 deletions support-files/mariadb-plugin-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2026, MariaDB plc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA

MACRO(DTRACE_INSTRUMENT)
ENDMACRO()
MACRO(ADD_VERSION_INFO)
ENDMACRO()
MACRO(MYSQL_INSTALL_TARGETS)
INSTALL(TARGETS ${ARGV})
ENDMACRO()
ADD_CUSTOM_TARGET(GenError)
Comment on lines +16 to +23

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not so easy. I need to try it on a plugin with tests


INCLUDE(FeatureSummary)

GET_FILENAME_COMPONENT(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
INCLUDE_DIRECTORIES(${prefix}/@INSTALL_INCLUDEDIR@/server ${prefix}/@INSTALL_INCLUDEDIR@/server/private)

@install_layout.cmake@

@plugin.cmake@
Comment thread
vuvova marked this conversation as resolved.