summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-02-18 15:16:27 +0100
committerSergei Golubchik <serg@mariadb.org>2015-02-18 15:16:27 +0100
commitd7e7862364ae344fea5657eb5aae9db3fbb84553 (patch)
tree38f30e541f98dae9092a09cf030de8f2a336bfd1 /cmake
parenta06624d61f36c70edd63adcfe2803bb7a8564de5 (diff)
parentfdd6c111c254c5044cd9b6c2f7e4d0c74f427a79 (diff)
downloadmariadb-git-d7e7862364ae344fea5657eb5aae9db3fbb84553.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cpack_source_ignore_files.cmake5
-rw-r--r--cmake/info_macros.cmake.in47
-rw-r--r--cmake/info_src.cmake8
-rw-r--r--cmake/make_dist.cmake.in41
-rw-r--r--cmake/plugin.cmake7
5 files changed, 49 insertions, 59 deletions
diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake
index 5db383ae73f..0874311428e 100644
--- a/cmake/cpack_source_ignore_files.cmake
+++ b/cmake/cpack_source_ignore_files.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -14,9 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CPACK_SOURCE_IGNORE_FILES
-\\\\.bzr/
-\\\\.bzr-mysql
-\\\\.bzrignore
CMakeCache\\\\.txt
cmake_dist\\\\.cmake
CPackSourceConfig\\\\.cmake
diff --git a/cmake/info_macros.cmake.in b/cmake/info_macros.cmake.in
index 9f40a419c61..fc2f8849337 100644
--- a/cmake/info_macros.cmake.in
+++ b/cmake/info_macros.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -23,11 +23,14 @@
# If further variables are used in this file, add them to this list.
SET(VERSION "@VERSION@")
+SET(MAJOR_VERSION "@MAJOR_VERSION@")
+SET(MINOR_VERSION "@MINOR_VERSION@")
+SET(PATCH_VERSION "@PATCH_VERSION@")
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
-SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
+SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
@@ -36,27 +39,51 @@ SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
# Create an "INFO_SRC" file with information about the source (only).
-# We use "bzr version-info", if possible, and the "VERSION" contents.
+# We use "git log", if possible, and the "VERSION" contents.
#
-# Outside development (BZR tree), the "INFO_SRC" file will not be modified
+# Outside development (git tree), the "INFO_SRC" file will not be modified
# provided it exists (from "make dist" or a source tarball creation).
MACRO(CREATE_INFO_SRC target_dir)
SET(INFO_SRC "${target_dir}/INFO_SRC")
- IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
- # Sources are in a BZR repository: Always update.
+ SET(PERLSCRIPT
+ "use warnings; use POSIX qw(strftime); "
+ "print strftime \"%F %T %z\", localtime;")
+ EXECUTE_PROCESS(
+ COMMAND perl -e "${PERLSCRIPT}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE bdate
+ ERROR_VARIABLE error
+ )
+ IF(error)
+ MESSAGE(STATUS "Could not determine build-date: <${error}>")
+ ENDIF()
+
+ IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
+ # Sources are in a GIT repository: Always update.
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE bname
+ )
+
EXECUTE_PROCESS(
- COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
+ COMMAND ${GIT_EXECUTABLE} log -1
+ --pretty="commit: %H%ndate: %ci%nbuild-date: ${bdate} %nshort: %h%nbranch: ${bname}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_INFO
- RESULT_VARIABLE RESULT
)
+
+ ## Output from git is quoted with "", remove them.
+ STRING(REPLACE "\"" "" VERSION_INFO "${VERSION_INFO}")
FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
# to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
# For better readability ...
- FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
+ FILE(APPEND ${INFO_SRC}
+ "MySQL source ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}\n")
ELSEIF(EXISTS ${INFO_SRC})
- # Outside a BZR tree, there is no need to change an existing "INFO_SRC",
+ # Outside a git tree, there is no need to change an existing "INFO_SRC",
# it cannot be improved.
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
# If we are building from a source distribution, it also contains "INFO_SRC".
diff --git a/cmake/info_src.cmake b/cmake/info_src.cmake
index 97776b70901..ce9873cc9d0 100644
--- a/cmake/info_src.cmake
+++ b/cmake/info_src.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -16,11 +16,11 @@
# The sole purpose of this cmake control file is to create the "INFO_SRC" file.
-# As long as and "bzr pull" (or "bzr commit") is followed by a "cmake",
+# As long as and "git pull" (or "git commit") is followed by a "cmake",
# the call in top level "CMakeLists.txt" is sufficient.
# This file is to provide a separate target for the "make" phase,
-# to ensure the BZR revision-id is correct even after a sequence
-# cmake ; make ; bzr pull ; make
+# to ensure the git commit hash is correct even after a sequence
+# cmake ; make ; git pull ; make
# Get the macros which handle the "INFO_*" files.
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index ada27c36926..c561baaa415 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -22,13 +22,12 @@ SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
-SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
+SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@")
SET(GTAR_EXECUTABLE "@GTAR_EXECUTABLE@")
SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
-SET(PLUGIN_REPOS "@PLUGIN_REPOS@")
SET(VERSION "@VERSION@")
@@ -40,38 +39,21 @@ SET(PACKAGE_DIR ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
FILE(REMOVE_RECURSE ${PACKAGE_DIR})
FILE(REMOVE ${PACKAGE_DIR}.tar.gz )
-IF(BZR_EXECUTABLE)
- MESSAGE(STATUS "Running bzr export")
+IF(GIT_EXECUTABLE)
+ MESSAGE(STATUS "Running git checkout-index")
EXECUTE_PROCESS(
- COMMAND "${BZR_EXECUTABLE}" export
- ${PACKAGE_DIR}
+ COMMAND "${GIT_EXECUTABLE}" checkout-index --all --prefix=${PACKAGE_DIR}/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RESULT
)
IF(NOT RESULT EQUAL 0)
- SET(BZR_EXECUTABLE)
+ SET(GIT_EXECUTABLE)
ENDIF()
ENDIF()
-IF(BZR_EXECUTABLE)
- FOREACH(REPO ${PLUGIN_REPOS})
- GET_FILENAME_COMPONENT(PLUGIN_NAME ${REPO} NAME)
- SET(DEST ${PACKAGE_DIR}/plugin/${PLUGIN_NAME})
- MESSAGE(STATUS "Running bzr export for plugin/${PLUGIN_NAME}")
- EXECUTE_PROCESS(
- COMMAND "${BZR_EXECUTABLE}" export ${DEST}
- WORKING_DIRECTORY ${REPO}
- RESULT_VARIABLE RESULT
- )
- IF(NOT RESULT EQUAL 0)
- MESSAGE(STATUS "bzr export failed")
- ENDIF()
- ENDFOREACH()
-ENDIF()
-
-IF(NOT BZR_EXECUTABLE)
- MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
+IF(NOT GIT_EXECUTABLE)
+ MESSAGE(STATUS "git not found or source dir is not a repo, use CPack")
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
# In-source build is the worst option, we have to cleanup source tree.
@@ -119,15 +101,6 @@ CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
-# Copy spec files
-SET(SPECFILENAME "mysql.${VERSION}.spec")
-IF("${VERSION}" MATCHES "-ndb-")
- STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
- SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
-ENDIF()
-CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/${SPECFILENAME}
- ${PACKAGE_DIR}/support-files/${SPECFILENAME} COPYONLY)
-
# Add documentation, if user has specified where to find them
IF(MYSQL_DOCS_LOCATION)
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 504e34414db..c1f6b8a0ea1 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -245,11 +245,4 @@ MACRO(CONFIGURE_PLUGINS)
ADD_SUBDIRECTORY(${dir})
ENDIF()
ENDFOREACH()
- FOREACH(dir ${dirs_plugin})
- IF (EXISTS ${dir}/.bzr)
- MESSAGE(STATUS "Found repo ${dir}/.bzr")
- LIST(APPEND PLUGIN_BZR_REPOS "${dir}")
- ENDIF()
- ENDFOREACH()
- SET(PLUGIN_REPOS "${PLUGIN_BZR_REPOS}" CACHE INTERNAL "")
ENDMACRO()