Makefile在CMake中等效 [英] Makefile equivalent in CMake

查看:104
本文介绍了Makefile在CMake中等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用CMake,它已经不到一个星期了。我有一个Makefile写,我试图在CMake中写它的等价物。我不知道在CMake中应该使用的命令在给定的Makefile中的每个语句。我如何开始?是否有一些地方可以找到这个文档?

I have just started using CMake and it has been less than a week. I have a Makefile written and I am trying to write its equivalent in CMake. I don't have an idea about the commands that I should use in CMake for each of the statements in the given Makefile. How do I get started? Is there some place I can find documentation for this?

推荐答案

我刚刚转换了我的项目(〜15000行C ++代码,共享库,单元测试和可执行文件)到CMake几个星期前,它只需要一两天做。

I just converted my project (~15000 lines of C++ code, builds shared libraries, unit tests, and executables) to CMake from scons a couple of weeks ago, and it only took a day or two to do.

Boost项目现在对CMake而不是bjam有实验性支持。看看他们的代码(具体来说, tools / build / CMake 中定义的宏)教会了我很多关于CMake的一些语法和功能。

One thing I found helpful was that the Boost project now has experimental support for CMake rather than bjam. Looking through their code (specifically, the macros defined in tools/build/CMake) taught me a lot about some of the syntax and capabilities of CMake.

也有用:

  • The official CMake FAQ
  • The online CMake documentation
  • A simple CMake tutorial
  • A quick overview of the language/syntax

希望这有帮助。

这篇关于Makefile在CMake中等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆