Using local makefile for CLion instead of CMake

后端 未结 6 803
醉酒成梦
醉酒成梦 2020-12-04 04:49

Is there a way to configure CLion to use a local makefile to compile code, rather than CMake? I can\'t seem to find the way to do it from the build options.

6条回答
  •  被撕碎了的回忆
    2020-12-04 05:17

    Newest version has better support literally for any generated Makefiles, through the compiledb

    Three steps:

    1. install compiledb

      pip install compiledb
      
    2. run a dry make

      compiledb -n make 
      

      (do the autogen, configure if needed)

    3. there will be a compile_commands.json file generated open the project and you will see CLion will load info from the json file. If you your CLion still try to find CMakeLists.txt and cannot read compile_commands.json, try to remove the entire folder, re-download the source files, and redo step 1,2,3

    Orignal post: Working with Makefiles in CLion using Compilation DB

提交回复
热议问题