[vtk-developers] New module system preview
David Thompson
david.thompson at kitware.com
Mon Oct 29 15:45:36 EDT 2018
>>>>> - Instead of `module.cmake`, there are `vtk.module` and `vtk.kit`
>>>>> files. These are basically CMake argument lists, but no variable
>>>>> expansion is allowed. If there are optional dependencies, they must
>>>>> be private dependencies. Optional public dependencies indicate that
>>>>> a new module should be made instead.
>>>>
>>>> Is there a reason these things need to be separate files
>>>> (vtk.module/vtk.kit) at all?
>>>
>>> The `vtk.kit` declares a kit. Membership into a kit is via `vtk.module`.
>>> Example `vtk.kit`:
>>
>> Yes, but why can't these declarations for modules and kits be inside
>> CMakeLists.txt as function calls instead of separate files?
>
> There's still a two-pass build pipeline. First is to get the declaration
> of the modules and build up the dependency graph. There is then a build
> step which builds modules in dependency order.
Even if it is two passes, why can't it be done from CMakeLists.txt? The second pass just adds library dependencies, header search paths, other target properties, and install rules, correct? Can't that be done any time after the libraries are declared?
It just feels like VTK and ParaView should be "best practices" examples. Your branch gets things a *lot* closer, but some twiddly details (the special .module/.kit files, no use of add_subdirectory, etc) get in the way of someone familiar with CMake but not these projects.
David
More information about the vtk-developers
mailing list