eclipse目前版本(至少时Luna以后的版本)对Cmake有着特殊的支持。如果不用该支持,会导致index不完全,很多地方出现红线无法解析的问题。本文阐述实战中如何对MySQL(AliSQL)进行导入。
MySQL(AliSQL)的版本已经是Cmake。git clone后,进入文件夹:
发现里面有一个build.sh脚本,我们做相应的动作
mkdir bu
./build.sh
之后会在bu下生成一堆目录和文件,里面的.cproject就是cmake为我们生成的eclipse工程文件。之后eclipse打开已有项目文件即可。
让我们看一下build.sh做了什么。下面是build.sh的内内容:
#!/bin/bash
#
# Script for Dev's daily work. It is a good idea to use the exact same
# build options as the released version.
get_key_value()
{
echo "$1" | sed 's/^--[a-zA-Z_-]*=//'
}
usage()
{
cat <<EOF
Usage: $0 [-t debug|release] [-d <dest_dir>] [-s <server_suffix>]
Or
$0 [-h | --help]
-t Select the build type.
-d Set the destination directory.
-s Set the server suffix.
-h, --help Show this help message.
Note: this script is intended for internal use by MySQL developers.
EOF
}
parse_options()
{
while test $# -gt 0
do
case "$1" in
-t=*)
build_type=`get_key_value "$1"`;;
-t)
shift
build_type=`get_key_value &#