summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2011-05-27 14:43:15 +0200
committerBjorn Munch <bjorn.munch@oracle.com>2011-05-27 14:43:15 +0200
commit41a3b5266014f0aa7d03eb16a9871fc0c365c313 (patch)
treebe71a40dec8136c0fbe531699a0b5d09cb18a1c6 /cmake
parent3b58613275b07e598f713d71ebfffa02262af6b7 (diff)
downloadmariadb-git-41a3b5266014f0aa7d03eb16a9871fc0c365c313.tar.gz
Bug #12598603 HAVE COLLECTIONS FILES IN FEATURE TREES AUTO-APPENDED TO COMMON FILES
Do this in the common plugin.cmake but only if running in PB2 (If done in manual builds it would create a bzr diff)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/plugin.cmake23
1 files changed, 22 insertions, 1 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index c6dd3fc451f..376dd84fc38 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, 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
@@ -27,6 +27,23 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
+# Append collections files for the plugin to the common files
+# Make sure we don't copy twice if running cmake again
+
+MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
+ SET(fcopied "${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/FilesCopied")
+ IF(EXISTS ${fcopied})
+ RETURN()
+ ENDIF()
+ FILE(GLOB collections ${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/*)
+ FOREACH(cfile ${collections})
+ FILE(READ ${cfile} contents)
+ GET_FILENAME_COMPONENT(fname ${cfile} NAME)
+ FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
+ FILE(APPEND ${fcopied} "${fname}\n")
+ ENDFOREACH()
+ENDMACRO()
+
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
@@ -180,6 +197,10 @@ MACRO(MYSQL_ADD_PLUGIN)
# Install dynamic library
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+ # For internal testing in PB2, append collections files
+ IF(DEFINED ENV{PB2WORKDIR})
+ PLUGIN_APPEND_COLLECTIONS(${plugin})
+ ENDIF()
ELSE()
IF(WITHOUT_${plugin})
# Update cache variable