Compile and Installation of VTK 9.2.6 with CMake and Visual Studio

Hello,

I am trying to compile and install VTK 9.2.6 on Windows 10 using CMake 3.21.3 and Visual Studio 2019. I am using CMake to configure and generate the necessary files to build the project. I am modifying the CMAKE_INSTALL_PREFIX variable to F:/VTK. Once that’s done, I open VTK.sln with Visual Studio 2019 and right-click on ALL_BUILD and build the project. Everything finishes correctly. However, when I go to the F:/VTK directory, it does not exist and I do not have my DLLs.

Can someone help me to solve my problem?

hello,

I’m not expert but i faced some difficulties with vtk, vs and cmake that i solved already. so maybe i can help you.
Can you share your cmake?

Oh sorry i didn’t understood well.

did you also INSTALL it? In vs normally, in the same tree that your ALL_BUILD is located, you have also INSTALL. sor first ALL_BUILD all configuration that you want (x64 release debug… etc) then when you finish, build the INSTALL one.

1 Like

Hi,

I am not sure this will be an exact solution to your problem but I also had some difficulties on windows 11 with cmake. However then I discovered vcpkg which has VTK. It compiled/installed in 4 hours and is running without any issue what so ever. I think it saves loads of time to use vcpkg. I do not know whther windows 10 can run vcpkg.

This is only if you do not get anywhere with cmake.

Thank you for your answer I will try to build the INSTALL after the ALL_BUILD, but I am not sure if it is the process. If you watch the video at 5min40 https://www.youtube.com/watch?v=IgvbhyDh8r0&t=559s he just build ALL_BUILD and then in c:/Program files/VTK 6.1.0 folder all dll are installed.

PS : Attached my CMakeLists.txt file
CMakeLists.txt (19.5 KB)

in my memory i had to install it. Dont necessarily believe all of this video. Usually peoples who do this videos already installed librairies so probably he just forgot to show to install it but as he already did it before, everything look ok.