Keep CMakeLists.txt update CMakeListsPrivate.txt

From time to time I have to “reinit” my PIO/CLion project. For example “pio init --ide clion --board lolin32” It always destroys my CMakeLists.txt. Is there a way to reinit a project? I mean keep the CMakeLists.txt and renew CMakeListsPrivate.txt and all the other pio-stuff like .pioenvs and .piolibdeps?

At the moment I run e.g. ‘cp CMakeLists.txt CMakeLists.works.txt && pio init --ide clion --board lolin32 && cp CMakeLists.works.txt CMakeLists.txt’ but thats a rather odd solution…

1 Like

Which changes do you need in CMake? Please use Redirecting... instead.

Probably everyone using clion is in trouble

If I add a new library for example. pio init --ide clion --board lolin32 adds the new lib in CMakeListsPrivate.txt which is OK but it should leave CMakeLists how it is.

Similar issue

We depend on the new project generate which will resolve these problems. Temporary solution is to create own TXT CMAKE file and just include it, similar as we do here
https://github.com/platformio/platformio-core/blob/develop/platformio/ide/tpls/clion/CMakeLists.txt.tpl#L4