Problem in building SlicerCustomAppTemplate

Hello,

I am trying to build SlicerCustomAppTemplate to create customized Slicer application. I am following the tutorial of https://blog.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/
and https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#CHECKOUT_slicer_source_files.

While creating the directory in github, when I clone it, it is showing empty repository which has no CMakeLists.txt. I don’t understand the procedure for cloning it.

Also If I copy the CMakeLists.txt in my folder and configure it using CMake-gui, it shows me following errors -
CMake Warning at SlicerApp-rel/slicersources-src/CMake/SlicerBlockFindQtAndCheckVersion.cmake:22 (find_package):
Found package configuration file:

C:/Qt2/5.12.5/msvc2017_64/lib/cmake/Qt5/Qt5Config.cmake

but it set Qt5_FOUND to FALSE so package “Qt5” is considered to be NOT
FOUND. Reason given by package:

Failed to find Qt5 component “WebEngine” config file at
“C:/Qt2/5.12.5/msvc2017_64/lib/cmake/Qt5WebEngine/Qt5WebEngineConfig.cmake”

Failed to find Qt5 component “WebEngineWidgets” config file at
“C:/Qt2/5.12.5/msvc2017_64/lib/cmake/Qt5WebEngineWidgets/Qt5WebEngineWidgetsConfig.cmake”

Call Stack (most recent call first):
SlicerApp-rel/slicersources-src/CMake/SlicerBlockFindQtAndCheckVersion.cmake:67 (__SlicerBlockFindQtAndCheckVersion_find_qt)
SlicerApp-rel/slicersources-src/CMakeLists.txt:600 (include)

CMake Error at SlicerApp-rel/slicersources-src/CMake/SlicerBlockFindQtAndCheckVersion.cmake:30 (message):
error: Qt 5.6.0 was not found on your system.You probably need to set the
Qt5_DIR variable.
Call Stack (most recent call first):
SlicerApp-rel/slicersources-src/CMake/SlicerBlockFindQtAndCheckVersion.cmake:67 (__SlicerBlockFindQtAndCheckVersion_find_qt)
SlicerApp-rel/slicersources-src/CMakeLists.txt:600 (include)

I am using Windows with Visual Studio 2019 and QT 5.12.5.
Can someone please help me to solve the error and provide me steps in detail?

Thanks in advance.

Make sure to follow
these instructions to make sure you’ve selected the QWebEngine and Qt Script components whenever you selected to install the MSVC2017 x64 version of Qt 5.12. You can have a successful build with Qt 5.12 building Slicer with the VS2017 toolset (v141).

The rest of the Windows instructions can be found here -> https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Windows_2

1 Like

I have Visual Studio 2019 x64 version. Will it not work in it to build SlicerCustomAppTemplate?
Is MSVC 2017 mandatory for this installation?

Also, when we clone the repository, should it have CMakeLists.txt ? From where I can get it?
Could you please tell me exact procedure for this installation?

Thanks in advance.

Hi:

Using the Custom app template generation procedure (these are commands that should go into a bash shell or command prompt, you will need to have python installed):

pip install cookiecutter jinja2-github
cookiecutter gh:KitwareMedical/SlicerCustomAppTemplate

and following the prompts should create a directory contains the CMakeLists for your custom slicer build. You do no need to do a separate checkout of Slicer, or copy anything else in. Once you have that directory, you can configure and build starting from this point in the Slicer instructions.

This will require an appropriate Qt installation. When installing Qt you should enable QtWebEngine and Qt Script for the version of Qt you are installing. We currently test/build slicer with VS2015 and VS2017. However, Qt binaries for VS2017 should work in VS2019