简体   繁体   English

是否可以将CMakeLists.txt转换为Unix Makefile?

[英]Is it possible to convert CMakeLists.txt to Unix Makefile?

I'm trying to get rid of cmake in my project for some reasons. 由于某些原因,我试图摆脱我的项目中的cmake。 I need to create unix makefiles to build my project. 我需要创建unix makefile来构建我的项目。 If i use cmake to generate them for me, that makefiles would depend of cmake anyway. 如果我使用cmake为我生成它们,那么该makefile仍将依赖于cmake。 The only build tools that I can use is one from GNU toolchain. 我唯一可以使用的构建工具是GNU工具链中的一个。

cmake was invented to be a portable way to create makefiles. cmake被发明为创建makefile的可移植方式。 If you want to have a look at an alternative, take a look at bjam from boost . 如果您想看看替代方法,请查看boost的bjam This tool works with a lot of toolchains (called toolset in the bjam terminology) and is quite simple to use as cmake is. 该工具可用于许多工具链(在bjam术语中称为工具集),并且与cmake一样使用非常简单。

If you really want to get rid of cmake or bjam, then write your own makefiles taking the ones generated by cmake as a base for example... But this will limit the scope of systems and toolchains on which your code will compile. 如果您真的想摆脱cmake或bjam,请编写自己的makefile文件,例如以cmake生成的文件为基础。但是,这将限制您的代码在其上编译的系统和工具链的范围。 To be honest I would see rather that as a pain and encourage you to use bjam if you need better support for other toolsets. 老实说,我宁愿将其视为一种痛苦,如果需要其他工具集的更好支持,建议您使用bjam。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM