find_package(VTK REQUIRED) refuses to load

I am using CMake 4.4.2 in order to use Visual Studio 18 2026 supported since 4.2. I am building CompuCell3D from source. Why is it finding VTK 9.4.2 but refusing to use it? How do I work around this apparent CMake problem? Even if I insert the version into the find_package command it refuses. I do point VTK_DIR right at it, and it found it without using that.

CMake Error at core/pyinterface/CMakeLists.txt:40 (FIND_PACKAGE):
Could not find a configuration file for package “VTK” that is compatible
with requested version “”.

The following configuration files were considered but not accepted:

(Windows 11 AppData).../Library/lib/cmake/vtk-9.4/vtk-config.cmake, version: 9.4.2 (64bit)
  The version found is not compatible with the version requested.

Thanks.

Richard
30 year VTK user

Until someone with more knowledge stops by, here’s what I think is going on.

I’ve seen that happen when the requesting project is using different architecture than what VTK was built with.

From your error message, it says it found VTK 9.4.2 (64-bit). Check if your main project is also building for x64 architecture instead of x86 or something else.

Thanks so much. Believe it or not, I haven’t used Visual Studio in about 30 years (Mac and Linux only). -A x64 in the cmake command fixed that, and I got past some other CC3D errors after that.

glad to hear that worked :slight_smile: