Page 2 of 2

Re: Help using CLion + CMake + ESP-IDF v3.2.2

Posted: Tue Jul 09, 2019 9:57 pm
by meowsqueak
Thanks everyone for your help and advice.

Just to follow up, I now have it working properly in Linux and on Mac with v3.2. The key points are:
  • Set CMake options to "-DIDF_PATH=..." in Preferences > Build, Execution, Deployment > CMake
  • and add an entry to the Environments table to set IDF_PATH as well.
  • I also set PYTHON (to my pyenv virtualenv python bin) and PYTHONPATH (to the virtualenv's sitepackages directory).
  • Set the Generation Path to 'build' as that is the default for idf.py
Then builds can be done by CLion, and menuconfig, builds, flash etc can all be done by the $IDF_PATH/tools/idf.py command.

This is sufficient to avoid the old "make" workflow entirely.

Re: Help using CLion + CMake + ESP-IDF v3.2.2

Posted: Sat Oct 12, 2019 11:44 am
by MindReader32
EDIT: I opened a new topic for this here: https://esp32.com/viewtopic.php?f=13&t=12677

Now that the ESP-IDF is moving away from Make to Ninja (and Clion doesn't support Ninja) do any of the ESP engineers have any tips to get this to work with IDF v4.x+ please?

Thanks

Re: Help using CLion + CMake + ESP-IDF v3.2.2

Posted: Sun Oct 13, 2019 8:59 pm
by meowsqueak
Now that the ESP-IDF is moving away from Make to Ninja (and Clion doesn't support Ninja) do any of the ESP engineers have any tips to get this to work with IDF v4.x+ please?
I'm not an ESP engineer, but CMake supports numerous build tools and I'd be very surprised if the ESP-IDF CMake config does something that make can't handle (ninja is, by design, very simple, and probably a subset of make functionality), so you could just tell the CMake system to use make instead when building with CLion?

Or is there something in the ESP Cmake config that is ninja-specific and causes a problem with make?

EDIT: after reading your other thread, I think I understand where the confusion is coming from - the older ESP versions used explicit Makefiles, and Espressif replaced that with CMake (that's where their comment about changing the build system came from). However CMake can continue to generate Makefiles, if you pass the option to do so.