[vtkusers] CMake use either VTK 5.x or 6.0

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Jun 25 11:19:02 EDT 2013


On Tue, Jun 25, 2013 at 10:39 AM, Shawn Waldon <swaldon at cs.unc.edu> wrote:
> Hi all,
>
> I was reading over the build system migration guide
> http://www.vtk.org/Wiki/VTK/Build_System_Migration
> and I had a question.
>
> What if you have an application that you would like to support compilation
> against either VTK 5 or 6?  How should you handle that in CMake?

We were just talking about this in light of a recent report of linking
issues. The current path taken in the VTK examples to support both is
not ideal - it finds/links to every VTK library built if using VTK 6.
>
> Reason: I would like my application to be able to build on Ubuntu with the
> version of vtk that you can get from apt-get install libvtk (Currently 5.8
> and unlikely to update to 6.0 anytime soon as far as I know).  But when
> building for Mac or Windows where I have to compile vtk anyway, I would like
> to use the lastest version.
>
> I also like the idea of using only a subset of the vtk libraries as
> dependencies as explained in the migration guide.
>
> If anyone can point me in the right direction I would appreciate it.
>
I will see if we can collect our thoughts and address this use case, I
think it is important to still target the libraries you actually want
to use from VTK when finding >=6. After all, modularization was
supposed to make it easier to find/link to a subset rather than all of
VTK! Some fo this is addressed in the page you link to (COMPONENTS,
compiler definitions, VTK_LIBRARIES etc).

Marcus



More information about the vtkusers mailing list