summaryrefslogtreecommitdiff
path: root/cmake/make_dist.cmake.in
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-02-10 12:26:21 +0100
committerSergei Golubchik <serg@mariadb.org>2015-02-10 12:26:21 +0100
commit63108dc9d2cc9f31ae9927817652be465a17f767 (patch)
tree232741f1cc7f81f6d212d7c301b3c5c2fdc934fe /cmake/make_dist.cmake.in
parent5f63c9c067c59102d5d707c6ff086ece60edae9e (diff)
downloadmariadb-git-63108dc9d2cc9f31ae9927817652be465a17f767.tar.gz
Fix the tree to work in git. Backport corresponing 10.1 changes.
Diffstat (limited to 'cmake/make_dist.cmake.in')
-rw-r--r--cmake/make_dist.cmake.in44
1 files changed, 16 insertions, 28 deletions
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index ada27c36926..b8c8877ef61 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -23,12 +23,12 @@ 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,7 +40,20 @@ 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)
+IF(GIT_EXECUTABLE)
+ MESSAGE(STATUS "Running git checkout-index")
+ EXECUTE_PROCESS(
+ COMMAND "${GIT_EXECUTABLE}" checkout-index --all --prefix=${PACKAGE_DIR}/
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ RESULT_VARIABLE RESULT
+ )
+
+ IF(NOT RESULT EQUAL 0)
+ SET(GIT_EXECUTABLE)
+ ENDIF()
+ENDIF()
+
+IF(BZR_EXECUTABLE AND NOT GIT_EXECUTABLE)
MESSAGE(STATUS "Running bzr export")
EXECUTE_PROCESS(
COMMAND "${BZR_EXECUTABLE}" export
@@ -54,23 +67,7 @@ IF(BZR_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)
+IF(NOT BZR_EXECUTABLE AND NOT GIT_EXECUTABLE)
MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@@ -119,15 +116,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})