Help to Build project under WIn 10

Hi,

I am on win10 + VS2017 + VTK9.0.1. following this demo:
https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadAllUnstructuredGridTypes/

At the end, at Building the project: make command gives this message:
make: *** No targets specified and no makefile found. Stop.

I have run cmake -DVTK_DIR:PATH=/home/me/vtk_build …, but can’t found a makefile.

Cheers,

Cean

I opened the vcxproj file with VS, build 2 succeedfully. But I can’t find any exe files. Where are they?

If I build Release version, under my Build folder, there is an empty Release sub-folder and a Win32 subfolder.
Under the Win32 subfolder, there is a Release sub-folder, with ALL_Build and Zero_Check subfolder. But no exe file in them.

Those build instructions are only accurate for linux. Visual Studio’s make tool is not called make but nmake and CMake does not generate a compatible makefile for it by default.

Instead of make, the correct, platform-independent command to build the project is:

cmake --build . --config Release

(replace Release by your actual build mode: Debug, Release, RelWithDebInfo, MinSizeRel)

If you use multi-configuration build toolchain (typical on Windows and macOS), then the binaries will be in build/ folder.

@amaclean I wanted to send a merge request that fixes these instructions in https://gitlab.kitware.com/vtk/vtk-examples/-/blob/master/src/Admin/VTKCMakeLists but forking of the repository took forever, so I gave up.

Firstly, in Build folder, I run:
cmake -DVTK_DIR:PATH=c:/bjVTK/lib/cmake/vtk-9.0 …
It generated CMakefiles folder and some vcxproj files.

Secondly, I run:
cmake --build . --config Release
It generated Release folder and Win32 folder. Still no where to find an exe file. It looks like the result is the same as opening the vcxproj file and build within VS. I was expecting to build within VS.

The other thing is I only compiled VTK into c:/bjVTK, but not installed it. Because when I try to build the Install target, it failed to copy files to c:/program files (x86) folder due to no access right.
I also put c:/bjVTK/bin into PATH.

What else I could do?

@lassoan You should be able to fork Ok, it will take some time. If it takes a long time try agan after a few hours.

I’m not sure what the cmake issue as I have no trouble building using the cmake-gui and specifyimg either visual studio or ninja.

@amaclean Using cmake-gui, I set VTK_DIR to C:/bjVTK/lib/cmake/vtk-9.0
the error message is:
Skipping ReadAllUnstructuredGridTypes: Could not find the VTK package with the following required components: RenderingContextOpenGL2.

Maybe you haven’t specified OpenGL2 in your VTK build. This discussion may help: https://discourse.vtk.org/t/two-questions-about-new-module-system/2864/17

Andrew Maclean

All the opengl2 setting is at DEFAULT in CMakefiles.txt, but after build, can’t find
vtkRenderingContextOpenGL2-9.0.dll. in the bin folder.

I changed the setting of RenderingContextOpenGL2 from DEFAULT to Yes and recompiled VTK, seems working now. I can generate exe file after cmake-gui.

That is really good news, glad you could solve it. I was going to ask if vtkRenderingContextOpenGL2-9.0.dll actually existed in the bin folder.

Also be very careful with your paths, make sure that, for example, if VTK was built using Debug, then your code should also be built using Debug.