diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
commit | 9809f05199aeb0b67991fac41bd86f38730768dc (patch) | |
tree | fa2792ff86d0da014b535d743759810612338042 /cmake/plugin.cmake | |
parent | 0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff) | |
parent | 5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff) | |
download | mariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz |
5.5-merge
Diffstat (limited to 'cmake/plugin.cmake')
-rw-r--r-- | cmake/plugin.cmake | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 31e1fceec23..615b1d7a717 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,8 +27,24 @@ 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(NOT EXISTS ${fcopied}) + 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() + ENDIF() +ENDMACRO() + MACRO(MYSQL_ADD_PLUGIN) - CMAKE_PARSE_ARGUMENTS(ARG + MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME" "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" ${ARGN} @@ -123,7 +139,7 @@ MACRO(MYSQL_ADD_PLUGIN) # Update mysqld dependencies SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS} - ${target} CACHE INTERNAL "" FORCE) + ${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE) IF(ARG_MANDATORY) SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server" @@ -151,6 +167,7 @@ MACRO(MYSQL_ADD_PLUGIN) ENDIF() ENDIF() + ADD_VERSION_INFO(${target} MODULE SOURCES) ADD_LIBRARY(${target} MODULE ${SOURCES}) DTRACE_INSTRUMENT(${target}) SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" @@ -179,6 +196,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 @@ -206,4 +227,11 @@ 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() |