如何在 linux 和 clion 上启动 imgui 和 运行

How can I get imgui up and running on linux and clion

免责声明:我是一个 jvm 用户,我所知道的只是通过 cmake 设置一个本地程序

我想在 Ubuntu (19.10)

下获取 imgui glfw-opengl3 示例 运行

在Windows中很容易,已经有一个vs project file

但是 Linux 我不知道如何继续。

尝试使用 CLion,我遵循了 this guide

现在,how/what我要进行(调试)配置吗?

编辑:现在还有一个 CMakeLists.txt,供有兴趣的人使用

让我们从头开始。

在使用 bear 生成 compile_commands.json 之后(仅 运行 bear make),我在 CLion 中将 compile_commands.json 作为项目打开。

然后您需要创建自定义构建目标。单击工具栏中的添加配置并找到 Custom Build Application Add Configuration

然后点击 Configure Custom Build Targets link 并添加一个新目标(example_glfw_opengl3 在我的例子中)。至于构建,我使用带有下一个参数的外部任务:

  • 程序:make
  • 参数:all
  • 工作目录:$ContentRoot$

清洁方面非常相似:

  • 程序:make
  • 参数:clean
  • 工作目录:$ContentRoot$

然后您需要通过 CLion 菜单构建可执行文件 Build | Build Project。现在您可以在自定义构建应用程序 运行 配置菜单中指定可执行文件。而已。现在您可以 Run/Debug 您的应用。