summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-14 16:13:31 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-14 16:13:31 +0200
commit6d05a95c652dd0b39dd1337a1514365b58957bf9 (patch)
tree77274e16ab5fd5823620d5ac3a49dca6df0559db /cmake
parent666565c7f00b0f39bbb459a428efd0093ed05fc8 (diff)
parente4205fba7c02b119ceea251f1484730066c2dedc (diff)
downloadmariadb-git-6d05a95c652dd0b39dd1337a1514365b58957bf9.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Internal/CPack/CPackRPM.cmake2
-rw-r--r--cmake/cpack_deb.cmake13
-rw-r--r--cmake/cpack_rpm.cmake5
-rw-r--r--cmake/mysql_version.cmake1
-rw-r--r--cmake/plugin.cmake18
5 files changed, 33 insertions, 6 deletions
diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake
index 6e376b2255f..174d28b9a14 100644
--- a/cmake/Internal/CPack/CPackRPM.cmake
+++ b/cmake/Internal/CPack/CPackRPM.cmake
@@ -24,6 +24,7 @@ endmacro()
set_from_component(LICENSE)
set_from_component(VENDOR)
+set_from_component(VERSION)
#
# Support for the %posttrans scriptlet
@@ -80,6 +81,7 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
restore(LICENSE)
restore(VENDOR)
+restore(VERSION)
if(${orig_${base_var}})
set(${base_var} ${orig_${base_var}})
endif()
diff --git a/cmake/cpack_deb.cmake b/cmake/cpack_deb.cmake
index 0539bcdff23..b253f8f86c7 100644
--- a/cmake/cpack_deb.cmake
+++ b/cmake/cpack_deb.cmake
@@ -7,5 +7,18 @@ SET(CPACK_COMPONENT_SERVER_GROUP "server")
SET(CPACK_COMPONENT_README_GROUP "server")
SET(CPACK_COMPONENTS_ALL Server Test SharedLibraries)
SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang")
+
+FUNCTION(SET_PLUGIN_DEB_VERSION plugin ver)
+ STRING(REPLACE "_" "-" plugin ${plugin})
+ STRING(REPLACE "-" "." serverver ${SERVER_VERSION})
+ STRING(REPLACE ${SERVER_VERSION} ${serverver} ver ${ver})
+ FILE(READ ${CMAKE_SOURCE_DIR}/debian/changelog changelog)
+ STRING(REPLACE ${serverver} ${ver} changelog "${changelog}")
+ FILE(WRITE ${CMAKE_SOURCE_DIR}/debian/mariadb-plugin-${plugin}.changelog "${changelog}")
+ENDFUNCTION()
+
+ELSE(DEB)
+FUNCTION(SET_PLUGIN_DEB_VERSION plugin ver)
+ENDFUNCTION()
ENDIF(DEB)
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 3c34ecfa83e..873a75fb9e5 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -33,13 +33,14 @@ SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
)
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
+SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
IF(CMAKE_VERSION VERSION_LESS "3.6.0")
- SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
+ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
ELSE()
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE)
- SET(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}")
+ SET(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}")
ENDIF()
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 85273136a32..fd8d02155b3 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -57,6 +57,7 @@ IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
ENDIF()
SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
+ SET(SERVER_VERSION ${VERSION})
MESSAGE(STATUS "MariaDB ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 9e848951f21..2e98afe9ec8 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -28,13 +28,14 @@ INCLUDE(CMakeParseArguments)
# [STATIC_OUTPUT_NAME static_name]
# [COMPONENT component]
# [CONFIG cnf_file_name]
+# [VERSION version_string]
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
MACRO(MYSQL_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"
+ "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;VERSION"
"LINK_LIBRARIES;DEPENDENCIES"
${ARGN}
)
@@ -117,6 +118,10 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(NOT ARG_DEPENDENCIES)
SET(ARG_DEPENDENCIES)
ENDIF()
+
+ IF(ARG_VERSION)
+ SET(version_string ";PLUGIN_${plugin}_VERSION=\"${ARG_VERSION}\"")
+ ENDIF()
IF(NOT ARG_MODULE_OUTPUT_NAME)
IF(ARG_STORAGE_ENGINE)
@@ -153,7 +158,7 @@ MACRO(MYSQL_ADD_PLUGIN)
DTRACE_INSTRUMENT(${target}_embedded)
IF(ARG_RECOMPILE_FOR_EMBEDDED)
SET_TARGET_PROPERTIES(${target}_embedded
- PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
+ PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY${version_string}")
ENDIF()
ADD_DEPENDENCIES(${target}_embedded GenError)
ENDIF()
@@ -204,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "")
IF (NOT ARG_CLIENT)
SET_TARGET_PROPERTIES (${target} PROPERTIES
- COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
+ COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN${version_string}")
ENDIF()
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})
@@ -240,7 +245,8 @@ MACRO(MYSQL_ADD_PLUGIN)
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}
AND INSTALL_SYSCONF2DIR)
IF (ARG_STORAGE_ENGINE)
- SET(ver " = %{version}-%{release}")
+ STRING(REPLACE "-" "_" ver ${SERVER_VERSION})
+ SET(ver " = ${ver}-%{release}")
ELSE()
SET(ver "")
ENDIF()
@@ -251,6 +257,10 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE)
ENDIF()
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE)
+ IF (ARG_VERSION)
+ SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_VERSION ${SERVER_VERSION}_${ARG_VERSION} PARENT_SCOPE)
+ SET_PLUGIN_DEB_VERSION(${target} ${SERVER_VERSION}-${ARG_VERSION})
+ ENDIF()
IF(NOT ARG_CLIENT AND UNIX)
IF (NOT ARG_CONFIG)
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.cnf")