# Can't build VTK sample project: Missing module

**URL:** https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056
**Category:** Support
**Created:** [March 15, 2022, 11:55am UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056 "2022-03-15T11:55:19Z")
**Posts on this page:** 1
**Showing post:** 21

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 4:58pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/21 "2022-03-15T16:58:11Z")

</div>

I just edited my CMakeLists.txt, it now looks like this:

```auto
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_TOOLCHAIN_FILE /home/ilmu011/Desktop/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-linux" CACHE STRING "")

set(CMAKE_PREFIX_PATH
/home/ilmu011/Desktop/vcpkg/installed/x64-linux/share/vtk
)

set(CMAKE_BUILD_TYPE Release)

set(FREETYPE_INCLUDE_DIR_freetype2 "/usr/include/freetype2")
set(FREETYPE_INCLUDE_DIR_ft2build "/usr/include/freetype2")
set(FREETYPE_LIBRARY_RELEASE "/usr/lib/x86_64-linux-gnu/libfreetype.so")

project(CylinderExample, LANGUAGES CXX)

find_package(VTK COMPONENTS 
  vtkCommonColor
  vtkCommonCore
  vtkFiltersSources
  vtkInteractionStyle
  # vtkRenderingContextOpenGL2
  vtkRenderingCore
  vtkRenderingFreeType
  # vtkRenderingGL2PSOpenGL2
  vtkRenderingOpenGL2
  QUIET
)

if (NOT VTK_FOUND)
  message("Skipping CylinderExample: ${VTK_NOT_FOUND_MESSAGE}")
  return()
endif()
message (STATUS "VTK_VERSION: ${VTK_VERSION}")
if (VTK_VERSION VERSION_LESS "8.90.0")
  # old system
  include(${VTK_USE_FILE})
  add_executable(CylinderExample MACOSX_BUNDLE CylinderExample.cxx )
  target_link_libraries(CylinderExample PRIVATE ${VTK_LIBRARIES})
else()
  # Prevent a "command line is too long" failure in Windows.
  set(CMAKE_NINJA_FORCE_RESPONSE_FILE "ON" CACHE BOOL "Force Ninja to use response files.")
  add_executable(CylinderExample MACOSX_BUNDLE CylinderExample.cxx )
  target_link_libraries(CylinderExample PRIVATE ${VTK_LIBRARIES})
  # vtk_module_autoinit is needed
  vtk_module_autoinit(
    TARGETS CylinderExample
    MODULES ${VTK_LIBRARIES}
    )
endif()

```

However, the INCLUDE\_DIRS seem to not have been apllied correctly… from the Cache:

```auto
//Path to a file.
FREETYPE_INCLUDE_DIR_freetype2:PATH=

//Path to a file.
FREETYPE_INCLUDE_DIR_ft2build:PATH=

//Path to a library.
FREETYPE_LIBRARY_DEBUG:FILEPATH=/home/ilmu011/Desktop/vcpkg/installed/x64-linux/debug/lib/libfreetyped.a

//Path to a file.
Fontconfig_INCLUDE_DIR:PATH=/home/ilmu011/Desktop/vcpkg/installed/x64-linux/include

```

How do I do this correctly?

---

_[View the full topic](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056)._
