# modules.json - Request for enhancement

**URL:** https://discourse.vtk.org/t/modules-json-request-for-enhancement/318
**Category:** Development
**Created:** [February 25, 2019, 5:05am UTC](https://discourse.vtk.org/t/modules-json-request-for-enhancement/318 "2019-02-25T05:05:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [February 25, 2019, 5:05am UTC](https://discourse.vtk.org/t/modules-json-request-for-enhancement/318/1 "2019-02-25T05:05:16Z")

</div>

@ben.boeckel it would be nice to add includes into `modules.json`.  
How much work would be entailed in adding a list of includes to this file for each module?

As an example, the module `VTK::CommonColor` would then look something like this:

```json
    "VTK::CommonColor": {
      "depends": [
        "VTK::CommonCore",
        "VTK::CommonDataModel"
      ],
      "description": "",
      "enabled": true,
      "implementable": false,
      "implements": [],
      "includes": [
        "vtkColorSeries.h",
        "vtkNamedColors.h"
      ],
      "kit": "VTK::Common",
      "library_name": "",
      "optional_depends": [],
      "private_depends": [],
      "third_party": false,
      "wrap_exclude": false
    },

```

If this is done then I have a reworked `WhatModulesVTK.py` that is around 100 lines long and just requires `modules.json` and the folder where the users code is. One of the advantages of using `modules.json` is that the users configuration is included in this file so for example we automatically know whether OpenGL or OpenGL2 is being used and whether the module is enabled. Maybe we could also detect missing modules and alert the user to rebuild VTK including these.

`modules.json` would grow from about 58k to about 123kb.

Currently my output from `WhatModulesVTK.py` looks something like this:

```nohighlight
find_package(VTK
 COMPONENTS
    CommonColor
    CommonCore
    FiltersSources
    InteractionStyle
    RenderingCore
    RenderingOpenGL2
)

```

**Note:** `InteractionStyle` and `RenderingOpenGL2` are not automatically found on the basis of includes in the users source files.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [February 25, 2019, 8:03am UTC](https://discourse.vtk.org/t/modules-json-request-for-enhancement/318/2 "2019-02-25T08:03:16Z")

</div>

+1 this would be great. Would gladly accept the extra kilobytes 🙂

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [March 1, 2019, 9:18pm UTC](https://discourse.vtk.org/t/modules-json-request-for-enhancement/318/3 "2019-03-01T21:18:16Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/merge\_requests/5256](https://gitlab.kitware.com/vtk/vtk/merge_requests/5256)
