I would like that my top cmakelist creates 2 targets for 2 hardware boards.
add_executable(myExec1 ) #board_V1
add_executable(myExec2 ) #board_V2
Now I would like to pass a parameter or an option to the feature/cmakelist so that this one depending on the board choses some parameters to build (e.g. some target_definitions depending on board or some sub-feature build depending on board).
│ CMakeList.txt
│ main.c
│
└───feature
CMakeList.txt
feature.c
feature.h
The project architecture is something like that and the key point for me here is that same feature target has different sub-feature depending on the calling target and to have all targets listed in one cmake.
main1 main2 main3
\_________|________/
|
feature
___|___
/ \
sub1 sub2
Is this even possible ? If not, what is the cmake way to do this ?