Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4f84d9ce
Commit
4f84d9ce
authored
Nov 20, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: MYSQL_PARSE_ARGUMENTS -> CMAKE_PARSE_ARGUMENTS
parent
061f84ab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
89 deletions
+57
-89
CMakeLists.txt
CMakeLists.txt
+1
-5
cmake/cmake_parse_arguments.cmake
cmake/cmake_parse_arguments.cmake
+0
-47
cmake/ctest.cmake
cmake/ctest.cmake
+3
-3
cmake/install_macros.cmake
cmake/install_macros.cmake
+18
-16
cmake/libutils.cmake
cmake/libutils.cmake
+6
-5
cmake/mysql_add_executable.cmake
cmake/mysql_add_executable.cmake
+23
-7
cmake/plugin.cmake
cmake/plugin.cmake
+6
-6
No files found.
CMakeLists.txt
View file @
4f84d9ce
...
...
@@ -14,11 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.6
)
# Avoid warnings in higher versions
if
(
"
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
"
GREATER 2.6
)
CMAKE_POLICY
(
VERSION 2.8
)
endif
()
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8.3
)
# explicitly set the policy to OLD
# (cannot use NEW, not everyone is on cmake-2.8.12 yet)
...
...
cmake/cmake_parse_arguments.cmake
deleted
100644 → 0
View file @
061f84ab
# Copyright (c) 2007, 2010, 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
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Handy macro to parse macro arguments
MACRO
(
MYSQL_PARSE_ARGUMENTS prefix arg_names option_names
)
SET
(
DEFAULT_ARGS
)
FOREACH
(
arg_name
${
arg_names
}
)
SET
(
${
prefix
}
_
${
arg_name
}
)
ENDFOREACH
(
arg_name
)
FOREACH
(
option
${
option_names
}
)
SET
(
${
prefix
}
_
${
option
}
FALSE
)
ENDFOREACH
(
option
)
SET
(
current_arg_name DEFAULT_ARGS
)
SET
(
current_arg_list
)
FOREACH
(
arg
${
ARGN
}
)
SET
(
larg_names
${
arg_names
}
)
LIST
(
FIND larg_names
"
${
arg
}
"
is_arg_name
)
IF
(
is_arg_name GREATER -1
)
SET
(
${
prefix
}
_
${
current_arg_name
}
${
current_arg_list
}
)
SET
(
current_arg_name
${
arg
}
)
SET
(
current_arg_list
)
ELSE
(
is_arg_name GREATER -1
)
SET
(
loption_names
${
option_names
}
)
LIST
(
FIND loption_names
"
${
arg
}
"
is_option
)
IF
(
is_option GREATER -1
)
SET
(
${
prefix
}
_
${
arg
}
TRUE
)
ELSE
(
is_option GREATER -1
)
SET
(
current_arg_list
${
current_arg_list
}
${
arg
}
)
ENDIF
(
is_option GREATER -1
)
ENDIF
(
is_arg_name GREATER -1
)
ENDFOREACH
(
arg
)
SET
(
${
prefix
}
_
${
current_arg_name
}
${
current_arg_list
}
)
ENDMACRO
()
\ No newline at end of file
cmake/ctest.cmake
View file @
4f84d9ce
INCLUDE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/cmake_parse_arguments.cmake
)
INCLUDE
(
CMakeParseArguments
)
MACRO
(
MY_ADD_TEST name
)
ADD_TEST
(
${
name
}
${
name
}
-t
)
ENDMACRO
()
MACRO
(
MY_ADD_TESTS
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"LINK_LIBRARIES;EXT"
"
"
${
ARGN
}
)
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"EXT"
"LINK_LIBRARIES
"
${
ARGN
}
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/include
${
CMAKE_SOURCE_DIR
}
/unittest/mytap
)
...
...
@@ -15,7 +15,7 @@ MACRO(MY_ADD_TESTS)
SET
(
ARG_EXT
"c"
)
ENDIF
()
FOREACH
(
name
${
ARG_
DEFAULT_ARG
S
}
)
FOREACH
(
name
${
ARG_
UNPARSED_ARGUMENT
S
}
)
ADD_EXECUTABLE
(
${
name
}
-t
"
${
name
}
-t.
${
ARG_EXT
}
"
)
TARGET_LINK_LIBRARIES
(
${
name
}
-t mytap
${
ARG_LINK_LIBRARIES
}
)
MY_ADD_TEST
(
${
name
}
)
...
...
cmake/install_macros.cmake
View file @
4f84d9ce
...
...
@@ -13,12 +13,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
GET_FILENAME_COMPONENT
(
MYSQL_CMAKE_SCRIPT_DIR
${
CMAKE_CURRENT_LIST_FILE
}
PATH
)
INCLUDE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/cmake_parse_arguments.cmake
)
INCLUDE
(
CMakeParseArguments
)
FUNCTION
(
INSTALL_DEBUG_SYMBOLS
)
IF
(
MSVC
)
MYSQL_PARSE_ARGUMENTS
(
ARG
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"COMPONENT;INSTALL_LOCATION"
""
${
ARGN
}
...
...
@@ -30,7 +30,7 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
IF
(
NOT ARG_INSTALL_LOCATION
)
SET
(
ARG_INSTALL_LOCATION lib
)
ENDIF
()
SET
(
targets
${
ARG_
DEFAULT_ARG
S
}
)
SET
(
targets
${
ARG_
UNPARSED_ARGUMENT
S
}
)
FOREACH
(
target
${
targets
}
)
GET_TARGET_PROPERTY
(
type
${
target
}
TYPE
)
GET_TARGET_PROPERTY
(
location
${
target
}
LOCATION
)
...
...
@@ -110,13 +110,14 @@ FUNCTION(INSTALL_MANPAGE file)
ENDFUNCTION
()
FUNCTION
(
INSTALL_SCRIPT
)
MYSQL_PARSE_ARGUMENTS
(
ARG
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"DESTINATION;COMPONENT"
""
${
ARGN
}
)
SET
(
script
${
ARG_
DEFAULT_ARG
S
}
)
SET
(
script
${
ARG_
UNPARSED_ARGUMENT
S
}
)
IF
(
NOT ARG_DESTINATION
)
SET
(
ARG_DESTINATION
${
INSTALL_BINDIR
}
)
ENDIF
()
...
...
@@ -132,8 +133,8 @@ ENDFUNCTION()
FUNCTION
(
INSTALL_DOCUMENTATION
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"COMPONENT"
""
${
ARGN
}
)
SET
(
files
${
ARG_
DEFAULT_ARG
S
}
)
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"COMPONENT"
""
${
ARGN
}
)
SET
(
files
${
ARG_
UNPARSED_ARGUMENT
S
}
)
IF
(
NOT ARG_COMPONENT
)
SET
(
ARG_COMPONENT Server
)
ENDIF
()
...
...
@@ -212,8 +213,8 @@ IF(WIN32)
ENDIF
()
MACRO
(
SIGN_TARGET
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"COMPONENT"
""
${
ARGN
}
)
SET
(
target
${
ARG_
DEFAULT_ARG
S
}
)
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"COMPONENT"
""
${
ARGN
}
)
SET
(
target
${
ARG_
UNPARSED_ARGUMENT
S
}
)
IF
(
ARG_COMPONENT
)
SET
(
comp COMPONENT
${
ARG_COMPONENT
}
)
ELSE
()
...
...
@@ -248,8 +249,9 @@ ENDMACRO()
#
FUNCTION
(
MYSQL_INSTALL_TARGETS
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"DESTINATION;COMPONENT"
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"DESTINATION;COMPONENT"
""
${
ARGN
}
)
...
...
@@ -259,7 +261,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
MESSAGE
(
FATAL_ERROR
"COMPONENT argument required"
)
ENDIF
()
SET
(
TARGETS
${
ARG_
DEFAULT_ARG
S
}
)
SET
(
TARGETS
${
ARG_
UNPARSED_ARGUMENT
S
}
)
IF
(
NOT TARGETS
)
MESSAGE
(
FATAL_ERROR
"Need target list for MYSQL_INSTALL_TARGETS"
)
ENDIF
()
...
...
@@ -267,10 +269,9 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
MESSAGE
(
FATAL_ERROR
"Need DESTINATION parameter for MYSQL_INSTALL_TARGETS"
)
ENDIF
()
FOREACH
(
target
${
TARGETS
}
)
# If signing is required, sign executables before installing
IF
(
SIGNCODE
)
IF
(
SIGNCODE
)
SIGN_TARGET
(
${
target
}
${
COMP
}
)
ENDIF
()
# Install man pages on Unix
...
...
@@ -293,7 +294,8 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug
FUNCTION
(
INSTALL_DEBUG_TARGET target
)
MYSQL_PARSE_ARGUMENTS
(
ARG
CMAKE_PARSE_ARGUMENTS
(
ARG
""
"DESTINATION;RENAME;PDB_DESTINATION;COMPONENT"
""
${
ARGN
}
...
...
cmake/libutils.cmake
View file @
4f84d9ce
...
...
@@ -57,7 +57,7 @@ IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LI
SET
(
_SKIP_PIC 1
)
ENDIF
()
INCLUDE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/cmake_parse_arguments.cmake
)
INCLUDE
(
CMakeParseArguments
)
# CREATE_EXPORT_FILE (VAR target api_functions)
# Internal macro, used to create source file for shared libraries that
# otherwise consists entirely of "convenience" libraries. On Windows,
...
...
@@ -213,13 +213,14 @@ ENDMACRO()
# [OUTPUT_NAME output_name]
#)
MACRO
(
MERGE_LIBRARIES
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"EXPORTS;OUTPUT_NAME;COMPONENT;VERSION;SOVERSION"
CMAKE_PARSE_ARGUMENTS
(
ARG
"STATIC;SHARED;MODULE;NOINSTALL"
"OUTPUT_NAME;COMPONENT;VERSION;SOVERSION"
"EXPORTS"
${
ARGN
}
)
LIST
(
GET ARG_
DEFAULT_ARGS 0 TARGET
)
SET
(
LIBS
${
ARG_
DEFAULT_ARG
S
}
)
LIST
(
GET ARG_
UNPARSED_ARGUMENTS 0 TARGET
)
SET
(
LIBS
${
ARG_
UNPARSED_ARGUMENT
S
}
)
LIST
(
REMOVE_AT LIBS 0
)
IF
(
ARG_STATIC
)
IF
(
NOT ARG_OUTPUT_NAME
)
...
...
cmake/mysql_add_executable.cmake
View file @
4f84d9ce
...
...
@@ -24,21 +24,37 @@
# - add version resource
# - instruct CPack to do autenticode signing if SIGNCODE is set
INCLUDE
(
cmake_parse_a
rguments
)
INCLUDE
(
CMakeParseA
rguments
)
FUNCTION
(
MYSQL_ADD_EXECUTABLE
)
# Pass-through arguments for ADD_EXECUTABLE
MYSQL_PARSE_ARGUMENTS
(
ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
CMAKE_PARSE_ARGUMENTS
(
ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL"
"DESTINATION;COMPONENT"
""
${
ARGN
}
)
LIST
(
GET ARG_
DEFAULT_ARG
S 0 target
)
LIST
(
REMOVE_AT ARG_
DEFAULT_ARG
S 0
)
LIST
(
GET ARG_
UNPARSED_ARGUMENT
S 0 target
)
LIST
(
REMOVE_AT ARG_
UNPARSED_ARGUMENT
S 0
)
SET
(
sources
${
ARG_
DEFAULT_ARG
S
}
)
SET
(
sources
${
ARG_
UNPARSED_ARGUMENT
S
}
)
ADD_VERSION_INFO
(
${
target
}
EXECUTABLE sources
)
ADD_EXECUTABLE
(
${
target
}
${
ARG_WIN32
}
${
ARG_MACOSX_BUNDLE
}
${
ARG_EXCLUDE_FROM_ALL
}
${
sources
}
)
IF
(
ARG_WIN32
)
SET
(
WIN32 WIN32
)
ELSE
()
UNSET
(
WIN32
)
ENDIF
()
IF
(
ARG_MACOSX_BUNDLE
)
SET
(
MACOSX_BUNDLE MACOSX_BUNDLE
)
ELSE
()
UNSET
(
MACOSX_BUNDLE
)
ENDIF
()
IF
(
ARG_EXCLUDE_FROM_ALL
)
SET
(
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
)
ELSE
()
UNSET
(
EXCLUDE_FROM_ALL
)
ENDIF
()
ADD_EXECUTABLE
(
${
target
}
${
WIN32
}
${
MACOSX_BUNDLE
}
${
EXCLUDE_FROM_ALL
}
${
sources
}
)
# tell CPack where to install
IF
(
NOT ARG_EXCLUDE_FROM_ALL
)
IF
(
NOT ARG_DESTINATION
)
...
...
cmake/plugin.cmake
View file @
4f84d9ce
...
...
@@ -14,8 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
GET_FILENAME_COMPONENT
(
MYSQL_CMAKE_SCRIPT_DIR
${
CMAKE_CURRENT_LIST_FILE
}
PATH
)
INCLUDE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/cmake_parse_arguments.cmake
)
INCLUDE
(
CMakeParseArguments
)
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
# [STORAGE_ENGINE]
...
...
@@ -28,9 +27,10 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# [DEPENDENCIES target1...targetN]
MACRO
(
MYSQL_ADD_PLUGIN
)
MYSQL_PARSE_ARGUMENTS
(
ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
CMAKE_PARSE_ARGUMENTS
(
ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"LINK_LIBRARIES;DEPENDENCIES"
${
ARGN
}
)
...
...
@@ -41,8 +41,8 @@ MACRO(MYSQL_ADD_PLUGIN)
${
SSL_INCLUDE_DIRS
}
${
ZLIB_INCLUDE_DIR
}
)
LIST
(
GET ARG_
DEFAULT_ARGS 0 plugin
)
SET
(
SOURCES
${
ARG_
DEFAULT_ARG
S
}
)
LIST
(
GET ARG_
UNPARSED_ARGUMENTS 0 plugin
)
SET
(
SOURCES
${
ARG_
UNPARSED_ARGUMENT
S
}
)
LIST
(
REMOVE_AT SOURCES 0
)
STRING
(
TOUPPER
${
plugin
}
plugin
)
STRING
(
TOLOWER
${
plugin
}
target
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment