CMake with CLion - working!
Posted: Tue Oct 02, 2018 8:54 pm
Now that we have the new CMake support I decided to try to get it to work with CLion, my C++ IDE of choice. After some initial head-scratching I can now compile entire projects from within CLion. Code completation is also working. Awesome.
There is one key point to get it working:
I've not yet tried to debug via CLion and I doubt that is possible, but JetBrains have stated that they're going to put resources into embedded programming with CLion so we might eventually get that too. See this ticket, go up vote and put a note about ESP32-development.
The screenshots below shows how I set up CMake and Toochain. I had to delete the default one, otherwise CLion didn't want to use the one I specified for xtensa; not sure if that is a bug or me missing something.
There is one key point to get it working:
- When CLion launches CMake, environment variables from for example ~./bashrc are NOT propagated to the CMake process. As such your ${IDF_PATH}, ${PYTHON} and ${PATH} are blank causing things to break.
I've not yet tried to debug via CLion and I doubt that is possible, but JetBrains have stated that they're going to put resources into embedded programming with CLion so we might eventually get that too. See this ticket, go up vote and put a note about ESP32-development.
The screenshots below shows how I set up CMake and Toochain. I had to delete the default one, otherwise CLion didn't want to use the one I specified for xtensa; not sure if that is a bug or me missing something.