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

CMakeLists.txt add_executable has only one source file #421

Closed
hameno opened this Issue Jan 1, 2016 · 14 comments

Comments

Projects
None yet
3 participants
@hameno

hameno commented Jan 1, 2016

Hello,
I'm not sure if this is a bug, missing feature oder just expected but when I run
platformio init --board uno --ide clion
only one cpp file from my src folder is added to the add_executable setting.
I would expect all cpp files to be added there.

@ivankravets ivankravets self-assigned this Jan 1, 2016

@ivankravets ivankravets added the invalid label Jan 1, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 1, 2016

This is OK. CLion uses Cmake as core build system and depends on it. However, PlatformIO has own build system and doesn't depend on Cmake. PlatformIO generates minimal settings in CMakeLists.txt which are required to code autocompletion and etc.

@ivankravets ivankravets closed this Jan 1, 2016

@hameno

This comment has been minimized.

hameno commented Jan 1, 2016

But without them code completion in clion is not completely available for all files.

@ivankravets ivankravets reopened this Jan 1, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 1, 2016

Sure? Could you provide me simple projects with more that 1 file where I will see problems with autocompletion and etc.

Thanks.

@ivankravets ivankravets added help wanted and removed invalid labels Jan 1, 2016

@ivankravets ivankravets added this to the 2.7.1 milestone Jan 1, 2016

@hameno

This comment has been minimized.

hameno commented Jan 1, 2016

Sure, but it is not exactly code completion thats not working but rather the code insights on the side of the code (where the line numbers are).
My test case consists of the main.cpp and one class with header and source. When not added to the CmakeLists.txt the header file will not show links to the implemented methods in the source.
This happens with latest stable of platformio (2.7.0) and clion (1.2.4).

With SampleClass.cpp added to add_executable:
with_entry
and without:
without_entry
in project view:
project_view

Sample project:
ClionSample.zip

@ivankravets ivankravets added bug and removed help wanted labels Jan 1, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 1, 2016

Thanks, will fix it.

@hameno

This comment has been minimized.

hameno commented Jan 1, 2016

Thanks :)

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 4, 2016

@hameno

This comment has been minimized.

hameno commented Jan 6, 2016

Looks good!

ivankravets added a commit that referenced this issue Jan 6, 2016

@diejmon

This comment has been minimized.

diejmon commented Feb 5, 2017

What about files in ./lib folder? Code insights doesn't work in this folder.
CLion 2016.3.2
PlatformIO, version 3.3.0a10

@ivankravets

This comment has been minimized.

Member

ivankravets commented Feb 5, 2017

@diejmon have you tried to re-init project as described in docs?

@diejmon

This comment has been minimized.

diejmon commented Feb 5, 2017

@ivankravets yes, just tried this again. If I add all files in ./lib folder to add_executable(${PROJECT_NAME} ${SRC_LIST}) list, CLion works as expected.

@ivankravets

This comment has been minimized.

Member

ivankravets commented Feb 5, 2017

@diejmon I've got you. Please file a new issue https://github.com/platformio/platformio-core

Thanks!

@diejmon

This comment has been minimized.

diejmon commented Feb 5, 2017

@ivankravets Thanks for fast response! Will create a new issue soon.

@diejmon

This comment has been minimized.

diejmon commented Feb 5, 2017

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