You build the custom app template exactly as you build Slicer, see Build Instructions — 3D Slicer documentation