CMake和CCMake的区别 -- cmake-curses-gui

上一篇:“Install CMake”中已经安装好CMake,本文安装CCMake。


自从2年前一起接触了CMake和CCMake这两个概念,一直机械性的重复着使用那一套编译路子。从没仔细研究过这2者有什么区别?今天重装环境,偶然查了会,了解到CCMake is the GUI for manipulating files generated by / used by the cmake system.


网友这么总结:

ccmake is curses (terminal handling library) interface to CMake.

cmake is the CLI (Command Line Interface)


事实上有三个相关概念:

cmake:     A command line interface (CLI).

ccmake: An ncurses (terminal) GUI. (only available on Unix-like systems)

cmake-gui: A Qt-based GUI.


cmake is a console program so you need to fire up a console to use it. Then, in the console, switch to your designated build directory. If it doesn't exist yet, create it. The most basic form of calling cmake looks like this:


cmake /path/to/source/dir


cmake stores a lot of configuration settings in the project’s cache. This cache can be viewed and edited using the CMake GUI. This can be quite useful for seeing how a project is configured as the settings are presented in a nice list. You can also change these values so you can set your build type to “Release” to make a release build or you can add specific compiler flags.



Like cmake, ccmake is a console program, but it uses ncurses to make editing the cache variables more accessible. It inherits cmake's command line options, so anything said above about cmake essentially also applies to ccmake. To start, type


ccmake /path/to/source/dir


You will be presented with a ncurses UI which lets you edit the contents of the CMake cache. Use the cursor keys to navigate to any variable you want to change, then press Enter. If the variable is boolean, this will switch its state from ON to OFF or vice versa. Otherwise you can type in the new value of the variable and press Enter again to finish your edit. A short help text to each variable is displayed at the bottom in a status bar. Once you are done, press 'c' to reconfigure the build, then press 'g' to generate the native build system and exit ccmake. If you want to quit without generating, press 'q'.

By default, ccmake only displays a part of the available cache variables. Others may be marked as advanced settings and will only be shown to you if you press 't' - this toggles the display of advanced variables.



cmake-gui is a true graphical frontend for CMake, that is you don't have to mess with command line options. Once you've started cmake-gui, it will look similar to the first picture below. The first thing to do is to tell it the location of the source and build directories which is done via the two path selectors at the top.



摘录自:

https://secure.mash-project.eu/wiki/index.php/CMake:_Getting_Started#ccmake



参考:

http://johnlamp.net/cmake-tutorial-3-gui-tool.html             (讲的非常好,有空学习、翻译一下)

http://www.itk.org/Wiki/ITK/Configuring_and_Building   


CCMake的安装:

CCMake包含在cmake-curses-gui包中,所以安装很简单,已安装完CMake以后,只需执行如下命令:

sudo apt-get install cmake-curses-gui

即可完成CCMake的安装。
  • 7
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值