The project folder structure is as follows:
.
├── .cmake # Helper files for the cmake build system
├── external # Folder contains external libraries
├── lib # Static linked libraries used by the project and integration tests
│ └── exampleLib # Specific library
│ ├── include # Contains the public interface / headers of the library
│ ├── src # Contains the private header and source files
│ └── test # Contains unit tests and mocks for the library classes
├── projects # Projects folder
│ ├── firmware # Project for the firmware. Will be linked against the needed libraries in lib
│ | └── src # Contains amongst others the main.cpp file for the firmware
│ └── integrationtests # Projects for integration tests
│ └── src # Contains amongst others the main.cpp file for the integration test
├── scripts # Tools and utilities
└── README.md
The build.sh
script should be used for building the software.
$ bash build.sh # build all
$ bash build.sh -c # clean build
$ bash build.sh -x # build build all for ARM (cross-compiling)
$ bash build.sh -a # build app for x86 (native build)
$ bash build.sh -i -x # build integration tests lib for ARM (cross-compiling)
The full range of build commands can be displayed with the help option:
$ bash build.sh -h
The project can be built by the options in the blue menu bar on the bottom of vs code.
- Choose the cmake-kit. Valid options:
- x86_64-linux-gcc-toolchain
- arm-phytec-linux-gnueabi-gcc-toolchain
- Choose build type. Valid options:
- Debug
- Release
- (Optional) Choose the target to build: default=
[all]
- Start build with hitting the
build
button
- Setup the build kits for the Qt Creator:
- Execute:
./.qtcreator/setup-qtcreator-kits.sh
- Execute:
- Start Qt Creator
- Go to
File/Open a new File or Project...
and choose the top levelCMakeLists.txt
file. The Project loads and is ready to build.
When cross-compiling (-x
option), it is assumed that the ARM toolchain
has been previously activated. Otherwise the script will complain.
The ARM toolchain
must be downloaded and installed. Assuming it is installed in /opt/phytec-yogurt/
.