Use the following construct:
"CONFIG(debug, debug|release) { ... }" for debug mode compilation and "CONFIG(release, debug|release){...}" for release mode compilation. Then when the compilation is in debug and release proper scopes will get activated.
Bookmarks