Clion中使用makefile文件取代CMake

CLion中仅仅支持CMakeList.txt文件进行配置,为了使用CLion支持makefile文件,需要通过一些方法进行改变

转自Using local makefile for CLion instead of CMake

  • 安装compiledb
pip install compiledb
  • 进入相关包含makefile的文件目录,执行compiledb命令,如果有需要./configure,则提前执行
./cofigure    
compiledb -n make
  • 一旦用CLion打开包含生成的json文件后,CLion能够自动读取compile_commands.json文件,如果没有任何反应,则完全的删除相关目录,重新执行前面的步骤

猜你喜欢

转载自blog.csdn.net/qq_31261509/article/details/89382114