PlatformIO Community

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 http://docs.platformio.org/en/latest/projectconf/section_env_build.html 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