stm32cube: cmake: Pure refactoring of build script
stm32cube: cmake: Pure refactoring of build script

Reduce the code duplication in ext/hal/st/stm32cube/CMakeLists.txt by
using a foreach loop instead of copy-paste for each SoC.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

galak/zephyr,punitvara/zephyr,kraj/zephyr,finikorg/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,ldts/zephyr,punitvara/zephyr,explora26/zephyr,mbolivar/zephyr,mbolivar/zephyr,kraj/zephyr,ldts/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,galak/zephyr,galak/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,zephyriot/zephyr,galak/zephyr,kraj/zephyr,Vudentz/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,mbolivar/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,finikorg/zephyr,finikorg/zephyr,explora26/zephyr,kraj/zephyr,explora26/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,explora26/zephyr,punitvara/zephyr,nashif/zephyr,nashif/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,mbolivar/zephyr,punitvara/zephyr,explora26/zephyr,kraj/zephyr,finikorg/zephyr,mbolivar/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,Vudentz/zephyr,Vudentz/zephyr,ldts/zephyr,finikorg/zephyr,Vudentz/zephyr