# Cylinder Example Cannot be Created by CMake

**URL:** https://discourse.vtk.org/t/cylinder-example-cannot-be-created-by-cmake/8233
**Category:** Support
**Created:** [April 7, 2022, 3:59pm UTC](https://discourse.vtk.org/t/cylinder-example-cannot-be-created-by-cmake/8233 "2022-04-07T15:59:31Z")
**Posts on this page:** 1
**Showing post:** 44

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://discourse.vtk.org/user_avatar/discourse.vtk.org/freya_the_goddess/32/4942_2.png) [@Freya\_the\_Goddess](https://discourse.vtk.org/u/Freya_the_Goddess)
#### Post date: [April 10, 2022, 1:37pm UTC](https://discourse.vtk.org/t/cylinder-example-cannot-be-created-by-cmake/8233/44 "2022-04-10T13:37:11Z")

</div>

Hi all,

thanks for the reply it is finally work. Someone gives me the instruction

> [@Bash: vtk command not found](https://discourse.vtk.org/t/bash-vtk-command-not-found/8220/13):
>
> [BuildingVTK.md](https://discourse.vtk.org/uploads/short-url/xaoJkbz19HYI8IER5AacMeQxRiN.md) (4.2 KB)

Basically at the beginning, I activate python environment while do the building till installation. Install all needed Python packages as well for VTK.

Then I create personal directory named **Kitware** under **/opt/hamzstlib/** with branches for `src/ build/ install/`  
It will be like this:  
`/opt/hamzstlib/Kitware/build/VTK`  
`/opt/hamzstlib/Kitware/install/VTK`  
`/opt/hamzstlib/Kitware/src/VTK`

The source will contain the latest VTK from the website (VTK-9.1.0) then build it using `ccmake` and then I do `make install`.

It is installed to /usr/local and since I know from your posts what should be in the VTK installation directory I just move everything that is VTK related to  
`/opt/hamzstlib/Kitware/install/VTK`

Lastly, the most important so vtk-config.cmake can be found:  
I set the environment variable by  
`export VTK_DIR=/opt/hamzstlib/Kitware/install/VTK/lib/cmake/vtk-9.1`

Finally. Told you I never give up. Now I want to try all other examples. If I could maybe convert from C++ to Python for some examples… Good luck for me then…

Thank You all.

 ![1vtkbuild3](https://discourse.vtk.org/uploads/default/original/2X/f/fc8b83a4d3caea4acd4a249656b3030f250f1c29.png)  
 ![1vtkbuild6](https://discourse.vtk.org/uploads/default/original/2X/9/9b647242c348d090879025e6d06e96255934054e.png)

 ![1vtkexample2](https://discourse.vtk.org/uploads/default/original/2X/c/cebcb5ac8cc1a37a9c66aac587d2b9a82d99fb09.jpeg)

---

_[View the full topic](https://discourse.vtk.org/t/cylinder-example-cannot-be-created-by-cmake/8233)._
