Error building slicer on Windows 10 (CTK problem?)


I am trying to build slicer on Windows 10, using Visual Studios 2019 and Qt 5.10. I came across this error after building “ALL_BUILD” in release mode. Could it be that I needed to download some package beforehand?

47>CMake Error at CMakeLists.txt:792 (find_package):
47> By not providing “FindCTK.cmake” in CMAKE_MODULE_PATH this project has
47> asked CMake to find a package configuration file provided by “CTK”, but
47> CMake did not find one.
47> Could not find a package configuration file provided by “CTK” with any of
47> the following names:
47> CTKConfig.cmake
47> ctk-config.cmake
47> Add the installation prefix of “CTK” to CMAKE_PREFIX_PATH or set “CTK_DIR”
47> to a directory containing one of the above files. If “CTK” provides a
47> separate development package or SDK, be sure it has been installed.
47>-- Configuring incomplete, errors occurred!
47>See also “C:/Angela/S4/S4-Superbuild/Slicer-build/CMakeFiles/CMakeOutput.log”.
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(220,5): error MSB6006: “cmd.exe” exited with code 1.
47>Done building project “Slicer.vcxproj” – FAILED.
48>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
48>Building Custom Rule C:/Angela/S4/S4-s/CMakeLists.txt
========== Build: 41 succeeded, 7 failed, 0 up-to-date, 0 skipped ==========

Thanks in advance!

When configuring Slicer with CMake did you set to use the v140 toolset since you are using Visual Studio 2019?

It would be part of this section in the build instructions:

I am not sure if I did. Is there a way to check? Sorry, I am very new to this.

If you open up the main solution where you have ALL_BUILD and all of the other projects it should have “(Visual Studio 2015)” next to the project names if you have set the toolset correctly.

If you are using a recent CMakeGUI you would’ve specified Visual Studio 2019 as your generator, then you define platform and toolset below. So “X64” and then “v140”.

They don’t have “(Visual Studio 2015)” next to the project names.

I chose Visual Studios 2019 as my generator, but I did not define the platform nor toolset.