Multi-configuration from installed VTK

Hi all,

Recently we’ve found that our current setup in Plus is unable to support multi-configuration builds with installed VTK.

Is there a way to set up our CMake so that this is possible?

(Related Plus issue.)

Some questions:

  • Are you using a multi-config generator to build VTK (Visual Studio or Xcode)?
  • If not, are you doing completely separate builds or resetting CMAKE_BUILD_TYPE in the same build tree?
  • What configurations are you looking to co-install? One release (be it Release, RelWithDebInfo, or MinSizeRel) and one debug (Debug)? Do you want to support all four?

Oh, and is this with 8.90 or 8.2?

Hi Ben, thanks for your help.

We’re using VTK 8.2 with Visual Studio 2015.

We would like to implement to be compatible with all build configurations.

  • I really recommend using a single build tree for generating this (either with Visual Studio and --config or by switching CMAKE_BUILD_TYPE and rerunning the install)
  • The CMAKE_$<CONFIG>_POSTFIX cache variable can be used to add custom suffixes based on the release. Alternatively, VTK_CUSTOM_LIBRARY_SUFFIX could be used if that fails.

8.2 is probably robust with these settings. If something more is necessary, we can look at supporting it properly in 8.90+ since I suspect it behaves similarly in this situation. If it isn’t enough, I recommend narrowing down the libraries you bring in by using find_package(VTK COMPONENTS) rather than importing every library built. Reducing how much of VTK is built is also a solution here (something probably worthwhile anyways).

I’m stepping out for a few days, but feel free to ping me and I’ll take a look when I’m back.