简体   繁体   English

在CLion中导入非cmake GitHub项目

[英]Import non-cmake GitHub project in CLion

Checking CLion help https://www.jetbrains.com/help/clion/2016.2/importing-existing-non-cmake-project.html I see how to import a non-CMake project into CLion. 检查CLion帮助https://www.jetbrains.com/help/clion/2016.2/importing-existing-non-cmake-project.html我看到了如何将非CMake项目导入CLion。

And I'm also able to clone a project from GitHub https://www.jetbrains.com/help/clion/2016.2/cloning-a-repository-from-github.html 而且我也能够从GitHub克隆一个项目https://www.jetbrains.com/help/clion/2016.2/cloning-a-repository-from-github.html

The project https://github.com/quickfix/quickfix uses ./bootstrap and ./configure to setup a makefile. 项目https://github.com/quickfix/quickfix使用./bootstrap./configure来设置makefile。

What I'd like to do is import that makefile into my CLion project and build and run from that. 我想要做的是将makefile导入我的CLion项目并从中构建和运行。 Is this possible? 这可能吗?

While it is possible to "import a project" that's not CMake-based into your CLion project, CLion does not itself directly support using Makefiles as an origination point for a project yet. 虽然可以将基于CMake的项目“导入”到您的CLion项目中,但CLion本身并不直接支持使用Makefile作为项目的起点。 I know that this is something that has been wanted by many people, and as far as I know, the creators of CLion are at some point planning to integrate some support for this. 我知道这是很多人都想要的东西,据我所知,CLion的创造者在某些时候正计划整合一些支持。

In the meantime, however, there is no handy way to do this directly. 然而,与此同时,没有直接的方法来做到这一点。 CMake is a build system configurator, in that it generates its own set of Makefiles to build everything, based on the things you write in your CMakeLists.txt file. CMake是一个构建系统配置器,它根据您在CMakeLists.txt文件中编写的内容生成自己的一组Makefile来构建所有内容。

Your best bet, should you want to use the quickfix lib in a project of yours, is to learn the CMake process for building an external dependency, and then linking it to your project. 你最好的选择,如果你想在你的项目中使用quickfix lib,就是学习构建外部依赖的CMake过程 ,然后将它链接到你的项目。 A good blog post on such a thing can be found here . 关于这样的事情的博客文章可以在这里找到。 If you simply want to work on changes to it in CLion for your own convenience, but keep the original build files, you could just have CLion generate its own little CMakeLists.txt file for the purposes of importing and color-coding everything, and then set your debug config, etc to point to the binaries generated by running make in the command line. 如果您只是想在CLion中对它进行更改以方便自己,但保留原始构建文件,您可以让CLion生成自己的小CMakeLists.txt文件,以便导入和颜色编码所有内容,然后将您的调试配置等设置为指向在命令行中运行make生成的二进制文件。

Long story short, there's no easy way to do what you are talking about directly, but depending on your intended purpose, there are a couple of alternate paths to a similar end. 简而言之,没有简单的方法可以直接做你正在谈论的事情,但是根据你的预期目的,有一些类似目的的替代途径。 Hope this helps! 希望这可以帮助!

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

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