I'm a CMake-beginner. Here's a problem I cannot figure out. I have a project structure that looks like this:
root
| common/
| include/
| public.h
| src/
| file-1.c
| file-2.c
| win-exec/
| main.c
| pico-exec/
| main.c
win-exec
is a Windows executable binary that depends on code in common/
. It also depends on GLFW and a few other Windows-specific libraries.
pico-exec
is another executable binary for the Raspberry Pi Pico that depends on code in common/
. This also has dependencies on the Pico SDK.
So basically I want different executables for different platforms.
How would you structure this as a CMake-project? The executables both need to compile the common code, since the executables need to be built for different architectures.
Is it possible to define different targets (with seperate toolchains) that somehow also recompiles the common code in the process? Or should I approach this outside of CMake with a batch-file for instance?