Just look on situation when you developing application that is for Android, Unix, iOS, MacOS from one source. And you application has DIFFERENT sets of files for Debug and Release. ONLY ONE way to use this different sets with XCode - to have debug/release settings in CMake, BEFORE XCode. Using expressions in CMake for definitions sets for XCode is impossible. All things that you've got written is about blocking normal developing for iOS. You require me to develop in separate way for iOS. CMAKE_BUILD_TYPE IS USED FOR CREATING DIFFERENT VERSIONS OF PROJECT AUTOMATICALLY BEFORE XCODE. Think of real world application but not of what XCode using or not. This settings for defining project structure not for XCode. The sets of file require NOT ONLY the CPP sources. It require icons, settings, even different Info.plist files and many other things. How you going to setup this things with #ifndef NDEBUG???
If you going to advise me to use something like this:
$<$CONFIG:Debug:${CMAKE_CURRENT_SOURCE_DIR}/dbgsrc.cpp>
Try to do it by yourself you will have error from XCode that it's not supported sources that have vary in configurations from expressions. In this case only one way is using CMAKE_BUILD_TYPE to set different type of projects within different sets of files at time of scanning and this scanned project passing to XCode.