Add option to control build of applications (feature #2568)