Merge branch 'backport-4.0-cmake-P-script-case'