I’m getting back into VTK after a long absence. I just built the C++ libs on Windows and I specified to build the examples when configuring with CMake. It generated the solution, and I built it, but could not find any built examples. I went into the build/Examples folder and loaded up the Examples VS solution file, and it seemed to have all boilerplate targets and didn’t generate any C++ executables when I built that solution. I must be missing something very basic here. Can someone clue me in?
The VTK nightly testing has moved completely to ninja as the build system, so there has been some decay in the VS and even the Makefile generators. The examples might fare better with cmake -G Ninja
but YMMV. On the plus side, ninja works very well with the MSVC toolchain, so all you lose is the IDE.
Thanks, David. I’ll give that a try. However:
That doesn’t seem like a minor point to me. Am I missing something?
I looked through the Examples/CMakeLists.txt
file and it looks like the examples have just been moved out of the main build. Here are two ways to build them that will work with Visual Studio:
A) build them as part of the testing, specifying either “Release” or “Debug” as the test config.
cd <vtk-build-dir>
ctest -R VTKExample -C Release
B) build them external to VTK
mkdir VTKExamples-build
cd VTKExamples-build
cmake -G <Generator> -DVTK_DIR=<vtk-build-dir> <vtk-source-dir>\Examples
Both of these will create a VTKExamples.sln
.