cmake: Kconfig: Minor refactorings in preparation for solving #5634
cmake: Kconfig: Minor refactorings in preparation for solving #5634

Minor refactoring of the build scripts in preparation for the patch
that resolves #5634.

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

ldts/zephyr,galak/zephyr,finikorg/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,nashif/zephyr,galak/zephyr,galak/zephyr,Vudentz/zephyr,ldts/zephyr,ldts/zephyr,galak/zephyr,Vudentz/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,ldts/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,galak/zephyr,nashif/zephyr,nashif/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr