Developing with CLion
1. Prerequisites
2. Build the Docker image
Open a terminal and run:
git clone https://github.com/RobotPatient-Research/SensorHub.git
cd SensorHub/firmware/.devcontainer
Then build the docker-image that is needed for clion to run the toolchain:
docker build -f Dockerfile -t sensorhub-clion-docker .
3. Open the project in CLion
- Open the
firmware
folder in CLion.
4. Set up the Docker toolchain
-
Go to File → Settings → Build, Execution, Deployment → Toolchains (or select Manage Toolchains).
-
Click the
+
button in the top-left corner and select Docker. -
Configure it as follows:
-
Image:
sensorhub-clion-docker:latest
- Build tool:
ninja
5. Build the project
- Once the toolchain is configured, let CLion index and configure the project.
- Click the Build button to build the firmware.
6. Changing the build target
To build for different hardware targets:
-
Click on the current CMake profile (e.g.,
Debug-Docker
) and select Edit CMake Profiles. -
Add a new profile and include the appropriate compile options (e.g.,
-DBUILD_...
).