Difference between revisions of "Eclipse CDT projects with bitbake"
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
− | Elphel camera software is based on Yocto Poky distribution, all the individual projects such as Linux kernel drivers, C/C++ applications, web applications, Python projects are organized as Makefile projects, each tied to a separate Git repository. The top project [https://git.elphel.com/Elphel/elphel393 elphel393] has the '''setup.py''' script that installs and synchronizes them. All projects have Eclipse IDE configuration data (in '''eclipse_project_setup''' subdirectories), and this data is copied to the project root by '''setup.py'''. As Eclipse project settings may have user-dependent settings, current configuration files (/.project, /.cproject, ...) are not version controlled, so to restore them after corruption or just to get updated versions you need either to manually copy '''eclipse_project_setup''' sub-tree, or delete /.project and re-run '''setup.py'''. | + | Elphel camera software is based on Yocto Poky distribution, all the individual projects such as Linux kernel drivers, C/C++ applications, web applications, Python projects are organized as '''Makefile''' projects, each tied to a separate Git repository. The makefiles are not standalone, they receive defined variables provided by '''bitbake''' recipes and classes. |
+ | |||
+ | The top project [https://git.elphel.com/Elphel/elphel393 elphel393] has the '''setup.py''' script that installs and synchronizes them. All projects have Eclipse IDE configuration data (in '''eclipse_project_setup''' subdirectories), and this data is copied to the project root by '''setup.py'''. As Eclipse project settings may have user-dependent settings, current configuration files (/.project, /.cproject, ...) are not version controlled, so to restore them after corruption or just to get updated versions you need either to manually copy '''eclipse_project_setup''' sub-tree, or delete /.project and re-run '''setup.py'''. | ||
Eclipse IDE setting reference not only files that are in the Git repository, but also those that are generated during build process, so Eclipse should be launched with these projects only after the command-line [[Poky_2.0_manual#Setup|build process]] has finished. If Eclipse is opened after some project is cleared (such as with '''bitbake -c clean''') it will delete the non-existing directories from '''.cproject''' configuration files. If that happens, you may close Eclipse and restore '''.cproject''' from the '''eclipse_project_setup/.cproject'''. | Eclipse IDE setting reference not only files that are in the Git repository, but also those that are generated during build process, so Eclipse should be launched with these projects only after the command-line [[Poky_2.0_manual#Setup|build process]] has finished. If Eclipse is opened after some project is cleared (such as with '''bitbake -c clean''') it will delete the non-existing directories from '''.cproject''' configuration files. If that happens, you may close Eclipse and restore '''.cproject''' from the '''eclipse_project_setup/.cproject'''. | ||
− | After running '''setup.py''' for the first time you may create the brand new workspace for Eclipse, that should have all necessary plugins (such as CDT and EGit at least) already installed. Workspace is created with '''setup_eclipse.py''' script, list of projects that it sets up is saved in '''setup_eclipse_paths.xml''' file. '''setup_eclipse.py''' provides usage information when launched without parameters, for normall run it requires full path to Eclipse installation | + | After running '''setup.py''' for the first time you may create the brand new workspace for Eclipse, that should have all necessary plugins (such as CDT and EGit at least) already installed. Workspace is created with '''setup_eclipse.py''' script, list of projects that it sets up is saved in '''setup_eclipse_paths.xml''' file. '''setup_eclipse.py''' provides usage information when launched without parameters, for normall run it requires full path to Eclipse installation - directory that contains '''eclipse''' executable and '''eclipse.ini''' configuration. |
+ | |||
+ | Projects are relying on '''bitbake''' build process, so main Eclipse build command launches '''bitbake ''target-name'' -c compile -f''' instead of '''make all''' or similar. And as error processing (problem highlighting in the source code, jump to source file/line) is possible only for the main builder, it is the '''CDT Builder''' that has to be configured this way. | ||
+ | |||
==Project Files and Directories== | ==Project Files and Directories== | ||
− | ├── bitbake-logs -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/temp | + | |
− | ├── eclipse_project_setup | + | Below is the file/directory list of a typical application ('''elphel-apps-astreamer''' is a subdirectory of '''elphel393/rootfs-elphel''', '''apps-astreamer''' - bitbake target for this project): |
+ | |||
+ | ├── '''bitbake-logs''' -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/temp | ||
+ | ├── '''eclipse_project_setup''' | ||
│ ├── .externalToolBuilders | │ ├── .externalToolBuilders | ||
│ │ └── SCP apps-astreamer to target.launch | │ │ └── SCP apps-astreamer to target.launch | ||
│ ├── .cproject | │ ├── .cproject | ||
│ └── .project | │ └── .project | ||
− | ├── .externalToolBuilders | + | ├── '''.externalToolBuilders''' |
│ └── SCP apps-astreamer to target.launch | │ └── SCP apps-astreamer to target.launch | ||
− | ├── image -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/image | + | ├── '''.git''' |
− | ├── scripts -> ../../scripts/ | + | ... |
− | │ ├── run_bitbake.sh | + | ├── '''image''' -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/image |
− | │ └── used_files.py | + | ├── '''scripts''' -> ../../scripts/ |
− | ├── .settings | + | │ ├── '''run_bitbake.sh''' |
+ | │ └── '''used_files.py''' | ||
+ | ├── '''.settings''' | ||
│ └── language.settings.xml | │ └── language.settings.xml | ||
− | ├── src | + | ├── '''src''' |
│ ├── audio.cpp | │ ├── audio.cpp | ||
│ ├── audio.h | │ ├── audio.h | ||
− | + | ... | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
│ ├── streamer.h | │ ├── streamer.h | ||
│ ├── video.cpp | │ ├── video.cpp | ||
│ └── video.h | │ └── video.h | ||
− | ├── sysroots -> /home/eyesis/nc393/elphel393/poky/build/tmp/sysroots | + | ├── '''sysroots''' -> /home/eyesis/nc393/elphel393/poky/build/tmp/sysroots |
− | ├── .cproject | + | ├── '''.cproject''' |
− | ├── .gitignore | + | ├── '''.gitignore''' |
− | ├── LICENSE | + | ├── '''LICENSE''' |
− | ├── Makefile | + | ├── '''Makefile''' |
− | ├── .project | + | ├── '''.project''' |
− | ├── README.md | + | ├── '''README.md''' |
− | └── VERSION | + | └── '''VERSION''' |
+ | |||
Revision as of 18:17, 21 November 2017
Introduction
Elphel camera software is based on Yocto Poky distribution, all the individual projects such as Linux kernel drivers, C/C++ applications, web applications, Python projects are organized as Makefile projects, each tied to a separate Git repository. The makefiles are not standalone, they receive defined variables provided by bitbake recipes and classes.
The top project elphel393 has the setup.py script that installs and synchronizes them. All projects have Eclipse IDE configuration data (in eclipse_project_setup subdirectories), and this data is copied to the project root by setup.py. As Eclipse project settings may have user-dependent settings, current configuration files (/.project, /.cproject, ...) are not version controlled, so to restore them after corruption or just to get updated versions you need either to manually copy eclipse_project_setup sub-tree, or delete /.project and re-run setup.py.
Eclipse IDE setting reference not only files that are in the Git repository, but also those that are generated during build process, so Eclipse should be launched with these projects only after the command-line build process has finished. If Eclipse is opened after some project is cleared (such as with bitbake -c clean) it will delete the non-existing directories from .cproject configuration files. If that happens, you may close Eclipse and restore .cproject from the eclipse_project_setup/.cproject.
After running setup.py for the first time you may create the brand new workspace for Eclipse, that should have all necessary plugins (such as CDT and EGit at least) already installed. Workspace is created with setup_eclipse.py script, list of projects that it sets up is saved in setup_eclipse_paths.xml file. setup_eclipse.py provides usage information when launched without parameters, for normall run it requires full path to Eclipse installation - directory that contains eclipse executable and eclipse.ini configuration.
Projects are relying on bitbake build process, so main Eclipse build command launches bitbake target-name -c compile -f instead of make all or similar. And as error processing (problem highlighting in the source code, jump to source file/line) is possible only for the main builder, it is the CDT Builder that has to be configured this way.
Project Files and Directories
Below is the file/directory list of a typical application (elphel-apps-astreamer is a subdirectory of elphel393/rootfs-elphel, apps-astreamer - bitbake target for this project):
├── bitbake-logs -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/temp ├── eclipse_project_setup │ ├── .externalToolBuilders │ │ └── SCP apps-astreamer to target.launch │ ├── .cproject │ └── .project ├── .externalToolBuilders │ └── SCP apps-astreamer to target.launch ├── .git ... ├── image -> /home/eyesis/nc393/elphel393/poky/build/tmp/work/cortexa9-neon-poky-linux-gnueabi/apps-astreamer/1_0-23/image ├── scripts -> ../../scripts/ │ ├── run_bitbake.sh │ └── used_files.py ├── .settings │ └── language.settings.xml ├── src │ ├── audio.cpp │ ├── audio.h ... │ ├── streamer.h │ ├── video.cpp │ └── video.h ├── sysroots -> /home/eyesis/nc393/elphel393/poky/build/tmp/sysroots ├── .cproject ├── .gitignore ├── LICENSE ├── Makefile ├── .project ├── README.md └── VERSION