[vtk-developers] VTKConfig.cmake new values

David Gobbi dgobbi at atamai.com
Tue Feb 28 12:00:49 EST 2006


Hi Brad,

I added two new values to VTKConfig.cmake last week 
(VTK_EXECUTABLE_DIRS, VTK_RUNTIME_PATH_VAR_NAME, VTK_PYTHON_DIRS) and 
thought that I should get in touch with you and Kitware to make sure 
that these additions make sense.

The VTK_EXECUTABLE_DIRS is meant to complement VTK_RUNTIME_DIRS and 
VTK_LIBRARY_DIRS.  The variables are set as follows for an installed VTK:

VTK_EXECUTABLE_DIRS = $prefix/bin
VTK_LIBRARY_DIRS = $prefix/lib
VTK_RUNTIME_DIRS = $prefix/bin on Windows, = $prefix/lib on everything else

Without VTK_EXECUTABLES_DIR, there is no easy way for derived packages 
to figure out where the VTK executables are kept.

I chose to call the variable VTK_EXECUTABLE_DIRS instead of 
VTK_BINARY_DIRS because I was worried that the latter sounds too similar 
to VTK_BINARY_DIR, which is something completely different.  If 
VTK_BINARY_DIR had been called VTK_BUILD_DIR then this confusion could 
have been avoided, but it's too late to change that ;)  The name 
VTK_RUNTIME_DIRS is confusing too: it should have been named 
VTK_RUNTIME_LIBRARY_DIRS to make it obvious that it is meant for 
libraries, since "runtime" is a vague term.  Is it too late to change 
that one?


The other big change I made was to add VTK_RUNTIME_PATH_VAR_NAME, which 
is set using the same rules as in the kwsys code you pointed me to a 
while ago.  It is computed using a cmake script, 
CMake/SharedLibraryPathVarName.cmake, which produces PATH as the Windows 
name, LD_LIBRARY_PATH for Linux, and various other crazy names for other 
platforms.

My reason for including it in VTKConfig.cmake is that on some systems, 
the name of the runtime path variable is build-specific.  For example, 
on IRIX you need to set LD_LIBRARYN32_PATH if VTK is built as 32-bit 
binaries and LD_LIBRARY64_PATH if VTK is built as 64-bit binaries.  The 
idea is that if people build their own packages based on VTK, this 
information can be used to set up the environment variables automatically.


The VTK_PYTHON_DIRS addition is fairly minor by comparison, it just 
contains the directories where the python modules (pure python and 
binary) can be found so that it can be used to set the PYTHONPATH.  
Another option would be to set a VTK_PYTHON_HOME variable instead, 
similar to the VTK_TCL_HOME, and generate Wrapping/Python/vtk.pth so 
that it points to where the binary modules. This would make it work 
similar to the way pkgIndex.tcl works.  Any opinions on whether the 
VTK_PYTHON_HOME approach would be preferable?


So I'm hoping that my changes can stay, but I realize that 
VTKConfig.cmake is not the kind of file that I should modify just to 
suit my own needs.

Cheers,
 - David









More information about the vtk-developers mailing list