Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake IDE/TPL added #3051

Closed
wants to merge 1 commit into from
Closed

CMake IDE/TPL added #3051

wants to merge 1 commit into from

Conversation

xeno010
Copy link

@xeno010 xeno010 commented Sep 26, 2019

This is very helpful when working with cmake without a specific IDE.

# Create new cmake project
platformio init --ide cmake --board <ID>

11 predefined targets for building

PLATFORMIO_BUILD - Build project without auto-uploading
PLATFORMIO_BUILD_VERBOSE - Build project without auto-uploading in verbose mode
PLATFORMIO_UPLOAD - Build and upload (if no errors)
PLATFORMIO_CLEAN - Clean compiled objects
PLATFORMIO_MONITOR - Device monitor platformio device monitor
PLATFORMIO_TEST - PIO Unit Testing
PLATFORMIO_PROGRAM - Build and upload using external programmer (if no errors), see Upload using Programmer
PLATFORMIO_UPLOADFS - Upload files to file system SPIFFS, see Uploading files to file system SPIFFS
PLATFORMIO_UPDATE - Update installed platforms and libraries via platformio update
PLATFORMIO_REBUILD_PROJECT_INDEX - Rebuild C/C++ Index for the Project. Allows one to fix code completion and code linting issues.
PLATFORMIO_DEVICE_LIST - List connected devices.

I use it on two big projects and it works great. I hope you'll add it for everyone.

@ivankravets
Copy link
Member

Have you seen platformio init --ide clion? You can write a script which generates project for CLIon and then removes not used CLIon related files

@xeno010
Copy link
Author

xeno010 commented Sep 26, 2019

Sure, but I'd have to delete the .idea folder every time even if I only call cmake PLATFORMIO_REBUILD_PROJECT_INDEX (->pio -f -c clion init --ide clion)

second problem:
PLATFORMIO_REBUILD_PROJECT_INDEX (-> pio -f -c clion init --ide clion) does not work properly in clion. It overwrites each time the files workspace.xml, watcherTasks.xml and modules.xml in the .idea folder. This means that all my custom file guards, my custom settings etc are deleted and I have to restart clion every time.

I develop in CLion and i use pio -f -c cmake init --ide cmake instead of pio -f -c clion init --ide clion(for rebuilding index) which only updates CMakeLists.txt and CMakeListsPrivate.txt.

@nghialm269
Copy link

This will also solve #2990, because if CMAKE_EXPORT_COMPILE_COMMANDS is set (env or in CMakeLists.txt), cmake will generate compile_commands.json for us.

@claassistantio
Copy link

claassistantio commented Jan 22, 2020

CLA assistant check
All committers have signed the CLA.

@ivankravets ivankravets requested a review from valeros February 5, 2020 20:49
@ivankravets ivankravets modified the milestone: 4.1.1 Feb 5, 2020
@ivankravets
Copy link
Member

We implemented #2990

What is a reason to use cmake wrapper around our CLI? We are on the way dropping support for CMake because of these are overheads.

@ivankravets
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants