Question : extension wizard with CmakeList.txt

Operating system: window 10
Slicer version: 5.2.1

Q1. Why is the cmake file always divided into two when I create a module through the extension wizard? Is there any reason not to do it with one?

Q2.Does anyone know about the CUSTOMSLICER build error?

The top level one is used for instructing how to build the Slicer Extension. The one inside the directory “VisualInspection” is used for instructing how to build the individual Slicer module. A Slicer extension can have multiple Slicer modules. Through the Extension Wizard you can see what it is like when you add multiple modules to your extension. You can also take a look at other Slicer extensions as examples.

Here is SlicerOpenIGTLink which has a mix of scripted loadable modules (python) and regular loadable modules (c++).