I updated to PlatformIO 6.1.10 and created a new project from CLI. Even this was not as straight forward as I’d like.
Problem
Apparently if I do: pio project init --board zero --project-dir "~/CLionProjects/MyNewProject" --ide clion
, I get Error: Invalid value for '--project-dir' / '-d': Directory '~/CLionProjects/MyNewProject' does not exist.
.
If I create the folder and use an absolute path (it did not work with the home directory - even with double-quotes), it creates a folder with a platformio.ini
and a couple of folders. I’d expect it to create CMakeLists.txt
and CMakeListsPrivate.txt
at this point.
However: even at a later point no such files are created. CLion does suggest creating it (and creates it if necessary) when opening any source file, but the file seems weird content-wise.
Since I have a CMakeLists.txt
and a CMakeListsPrivate.txt
flying around, it must have been generated at some point when I created a new project using CLion itself (along with the PlatformIO plugin). However: this does not work anymore (the only difference between then and now is the updated PlatformIO library).
So my questions are:
- When are the 2 CMakeLists files generated?
- When are they regenerated?
- And - most importantly - what should I do since these files don’t seem to be generated on my machine.
Versions
I am using PlatformIO 6.1.10 (previously 6.1.9), CLion v2023.1.3 and PlatformIO Plugin for CLion v231.8109.141.
Also I am on a MacBook M1 Pro with MacOS Ventura (13.5).
If you need any additional information, please let me know. Any help is greatly appreciated.
Edit
I verified, that on PlatformIO version 6.1.9
using Tools
→ PlatformIO
→ Re-Init
(or pio project init --board zeroUSB --ide clion
via CLI) indeed does generate CMakeLists.txt
and CMakeListsPrivate.txt
on the same project. So I suspect there being an issue with version 6.1.10
(not sure about 6.1.9_1
), which is why I filed a bug on platformio-core
: CMakeLists.txt and CMakeListsPrivate.txt no longer regenerated upon Re-Init (neither CLI nor CLion) · Issue #4718 · platformio/platformio-core · GitHub.