# Compile and Installation of VTK 9.2.6 with CMake and Visual Studio

**URL:** https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065
**Category:** Support
**Created:** [March 27, 2023, 10:10pm UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065 "2023-03-27T22:10:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mnekkach](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@mnekkach](https://discourse.vtk.org/u/mnekkach)
#### Post date: [March 27, 2023, 10:10pm UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/1 "2023-03-27T22:10:14Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 28, 2023, 9:58am UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/2 "2023-03-28T09:58:15Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 28, 2023, 2:11pm UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/3 "2023-03-28T14:11:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Zolo](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@Zolo](https://discourse.vtk.org/u/Zolo)
#### Post date: [March 29, 2023, 7:27am UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/4 "2023-03-29T07:27:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mnekkach](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@mnekkach](https://discourse.vtk.org/u/mnekkach)
#### Post date: [March 29, 2023, 7:43pm UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/5 "2023-03-29T19:43:53Z")

</div>

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](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](https://discourse.vtk.org/uploads/short-url/s4LptkUZVWUj1vnbYZFgdG4lysR.txt) (19.5 KB)

---

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 30, 2023, 10:37pm UTC](https://discourse.vtk.org/t/compile-and-installation-of-vtk-9-2-6-with-cmake-and-visual-studio/11065/6 "2023-03-30T22:37:36Z")

</div>

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.
