c++ - 如何使用 Clion 调试外部可执行文件

标签 c++ debugging ide clion

我想用 Clion 调试一个使用外部 makefile 创建的可执行文件。
我看到我可以在 Run/Debug Configurations --> Executable 中选择另一个可执行文件,但它会自动运行我的 CMakeLists,我不想这样做(因为它失败了)。

我知道 Clion 目前不支持“使用现有 makefile 导入项目”。

有办法吗?

最佳答案

  1. 使用 Cmakeadd_custom_command()add_custom_target() 我调用了我的 makefile
  2. Clion Run/Debug Configuration --> Executable 中,我从我的 makefile 中选择了已编译的可执行文件。

--- 编辑---
1.例子

add_custom_command(OUTPUT app_run.txt
    COMMAND /bin/echo "Not building!"
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(app_run ALL
    DEPENDS app_run.txt)

关于c++ - 如何使用 Clion 调试外部可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29328777/

相关文章:

c++ - C++中的连接字符串(STL)

JavaScript/Dojo 模块模式 - 如何调试?

c++ - C++ 的 Netbeans IDE 如何指定命令行参数

drupal - 好的 Drupal IDE?

c# - 如何在非托管 C++ dll 中查找调用方程序集名称

c++ - 引用容器/不可空指针

html - 用于 Google Chrome 的类似 Firebug 的调试器

git - 如何为基于 IDE 的项目设置 git 存储库?

java - Intellij - 并行运行

c++ - MASM 修复 DLL 中的 64 位截断