Eclipses 如何支持CMake Project

本文介绍了如何在Eclipse Luna及更高版本中支持CMake项目,特别是针对MySQL(AliSQL)的导入步骤。通过运行build.sh脚本,生成.cproject文件,然后在Eclipse Neon中打开,实现项目的完美索引,避免了编译错误。
摘要由CSDN通过智能技术生成

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 &#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值