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

meowsqueak
Posts: 140
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

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

Postby meowsqueak » Tue Jul 09, 2019 9:57 pm

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.

MindReader32
Posts: 23
Joined: Mon May 14, 2018 8:33 am

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

Postby MindReader32 » Sat Oct 12, 2019 11:44 am

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

meowsqueak
Posts: 140
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

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

Postby meowsqueak » Sun Oct 13, 2019 8:59 pm

MindReader32 wrote:
Sat Oct 12, 2019 11:44 am
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.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], Micrified and 13 guests