# Unknown CMake command "vtk\_module\_autoinit"

**URL:** https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621
**Category:** Support
**Created:** [November 4, 2023, 10:56am UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621 "2023-11-04T10:56:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Silokhin\_Ilya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/silokhin_ilya/32/7954_2.png) [@Silokhin\_Ilya](https://discourse.vtk.org/u/Silokhin_Ilya)
#### Post date: [November 4, 2023, 10:56am UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/1 "2023-11-04T10:56:27Z")

</div>

I downloaded VTK-8.2 and wanted to test it with an example. Example: [here](https://examples.vtk.org/site/Cxx/GeometricObjects/Sphere/). But I can not configure my project. An error occurs: CMake Error at CMakeLists.txt:28 (vtk\_module\_autoinit):  
Unknown CMake command “vtk\_module\_autoinit”. CMake version: 3.28. How can I fix this?

---

<div class="post-metadata">

### Author: ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)
#### Post date: [November 4, 2023, 1:18pm UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/2 "2023-11-04T13:18:46Z")

</div>

The examples have all been updated to work with VTK 9. If you don’t need vtk 8 for some other reason, upgrading to vtk 9 will fix your problem.

---

<div class="post-metadata">

### Author: ![Silokhin\_Ilya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/silokhin_ilya/32/7954_2.png) [@Silokhin\_Ilya](https://discourse.vtk.org/u/Silokhin_Ilya)
#### Post date: [November 4, 2023, 6:16pm UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/3 "2023-11-04T18:16:20Z")

</div>

The reason I installed VTK-8.2 is because I got a bunch of errors in VTK-9.3 when building VTK.sln. How can I fix them?

 ![BuildError](https://discourse.vtk.org/uploads/default/original/2X/b/b54c062913c89cb437a9a18b602e8b7b05030cc4.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 17, 2023, 3:54am UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/4 "2023-11-17T03:54:50Z")

</div>

What version of 9.3? Does 9.3.0 have this problem? Does it reproduce with the `Ninja` generator? Did you change any implicit array backend options?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 17, 2023, 3:55am UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/5 "2023-11-17T03:55:14Z")

</div>

Nevermind, I see [VTK-9.3 VTK.sln build failed](https://discourse.vtk.org/t/vtk-9-3-vtk-sln-build-failed/12622) now

---

<div class="post-metadata">

### Author: ![rick\_wong](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rick_wong/32/8037_2.png) [@rick\_wong](https://discourse.vtk.org/u/rick_wong)
#### Post date: [November 22, 2023, 3:21am UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/6 "2023-11-22T03:21:22Z")

</div>

I’m having same issue here when test with “Arrow” sample.  
VTK-9.3 having bunch of errors related to linking issue like what Silokhin see.  
VTK-8.2 will have CMake Error at CMakeLists.txt:29 (vtk\_module\_autoinit):  
Unknown CMake command “vtk\_module\_autoinit”. CMake version 3.27.7.  
Anyone can help?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 22, 2023, 1:43pm UTC](https://discourse.vtk.org/t/unknown-cmake-command-vtk-module-autoinit/12621/7 "2023-11-22T13:43:53Z")

</div>

The `vtk_module_autoinit` API was introduced in VTK 8.90 (9.0-prerelease). See [these docs](https://docs.vtk.org/en/latest/advanced/migration_guides/ModuleMigration.html).
