[vtk-developers] VTK Install Rules and Cross Compiling and ...

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Sun Aug 5 11:56:37 EDT 2012


Folks,

To give you some background, I am working on updating ParaView to
become simply a VTK with extra modules. As I am doing this here are
few problems that I noticed, or maybe I'm just missing something
obvious:

1. To support CrossCompiling, ParaView/VTK provides funky variables
EXPORT_EXECUTABLES_FILE, EXPORT_EXECUTABLES_NAMESPACE to which it
expects all compilation tools targets to be exported. However
vtkWrapHierarchy, vtkWrapPython etc., all use the macro
vtk_target(...) to set up the install rules. Now, vtk_target(..) uses
vtk_export(...) which exports to the VTK_EXPORTS_FILE file -- that's
issue number 1. Secondly, vtk_export(..) uses the variable
VTK_INSTALL_NO_LIBRARIES to decide if the targets should be exported,
that seems incorrect. If anything, for these executables, we should be
checking VTK_INSTALL_NO_DEVELOPMENT, isn't it?

2. vtk_target_export(...) which adds the export(..) calls to allow
external projects to use VTK build trees export the targets after
checking VTK_INSTALL_NO_LIBRARIES variable. Isn't that incorrect?
IMHO, export(..) should be added without any such VTK_INSTALL_NO_*
conditions. These variables dictate what "make install" does. I may
want to build a VTK where "make install" will only install the
executables, no libraries, but I may still want to build other
projects dependent on VTK directly by referring to the build
directory.

3. EXPORT_EXECUTABLES_FILE is never written out (and installed too
when VTK_INSTALL_NO_DEVELOPMENT is FALSE). Also, I am wondering if
VTKConfig or VTKTargets should import this file too (for install
directory version, it doesn't matter since if
VTK_INSTALL_NO_DEVELOPMENT was true, the development tools targets are
installed to the VTK_EXPORTS_FILE anyways, which I think is the right
behavior). That way projects depending on VTK will see the compile
tools too without having to do anything extra.

Here's my proposal:

a. Add a new vtk_build_tools_target(...) macro. This macro will be
used for all executable targets that VTK builds which are build tools
e.g. vtkWrapHierarchy, vtkWrapTclInit etc.
b. vtk_build_tools_target(...) will add install(...) rules, only when
VTK_INSTALL_NO_DEVELOPMENT is false, and *always* add export(...)
rules if EXPORT_EXECUTABLES_FILE is specified for exporting build-dir
targets to the EXPORT_EXECUTABLES_FILE.

b. All locations building these compile tools executables should
ensure that CMAKE_CROSSCOMPILING is FALSE (which is already the case,
but just to be sure).

c. vtk_target_export(...), used for exporting module libraries should
add the export(...) call irrespective of the state of
VTK_INSTALL_NO_LIBRARIES. VTK_INSTALL_NO_* variables should be used to
decide whether to make the install(...) calls, not the export(...)
calls.

d. EXPORT_EXECUTABLES_FILE, EXPORT_EXECUTABLES_NAMESPACE should be
renamed. These are only used for build/compile tools, so maybe call
them EXPORT_COMPILE_TOOLS_FILE, EXPORT_COMPILE_TOOLS_NAMESPACE or
something more obvious.

Once we have decided the path forward, I volunteer to make these changes.

Utkarsh



More information about the vtk-developers mailing list