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

CMakeLists.txt add_executable has only one source file #421

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

CMakeLists.txt add_executable has only one source file #421

hameno opened this issue Jan 1, 2016 · 14 comments
Assignees
Labels
Milestone

Comments

@hameno
Copy link

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
Copy link
Member

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.

@hameno
Copy link
Author

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
Copy link
Member

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 this to the 2.7.1 milestone Jan 1, 2016
@hameno
Copy link
Author

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
Copy link
Member

Thanks, will fix it.

@hameno
Copy link
Author

hameno commented Jan 1, 2016

Thanks :)

@ivankravets
Copy link
Member

@hameno
Copy link
Author

hameno commented Jan 6, 2016

Looks good!

@S2Ler
Copy link

S2Ler 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
Copy link
Member

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

@S2Ler
Copy link

S2Ler 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
Copy link
Member

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

Thanks!

@S2Ler
Copy link

S2Ler commented Feb 5, 2017

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

@S2Ler
Copy link

S2Ler commented Feb 5, 2017

#897

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

No branches or pull requests

3 participants