FS#72570 - [vtk] broken CMakeConfig.

Attached to Project: Community Packages
Opened by bartus (bartus) - Thursday, 28 October 2021, 14:39 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Saturday, 06 November 2021, 12:19 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

`vtk-config.cmake` uses a bunch of `Find${package}.cmake` script that doesn't conform with packaging scheme in the Arch repository (find path for header file doesn't contain `/usr/include/${package}`) those rendering any package build against `vtk:9.0.3` that uses CMake build system broken or misconfigured.

Effected dependencies: openvr, python-mpi4py, utf8cpp.

example: FindOpenVR.cmake
```
find_path(OpenVR_INCLUDE_DIR
NAMES
openvr_driver.h
PATH_SUFFIXES
headers
public/headers
steam
public/steam
DOC "OpenVR include directory")
mark_as_advanced(OpenVR_INCLUDE_DIR)
```

where `pacman -Fl openvr|grep include` shows:
```
openvr usr/include/openvr/openvr.h
openvr usr/include/openvr/openvr_capi.h
openvr usr/include/openvr/openvr_driver.h
```


Additional info:
* vtk:9.0.3, openvr:1.16.8

Steps to reproduce:

1. Install vtk and all optional deps.
2. Create boilerplate CMakeLists.txt
```
project(test)
find_pacakge(VTK)
```
3. run `cmake` on it.
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Saturday, 06 November 2021, 12:19 GMT
Reason for closing:  Upstream
Additional comments about closing:  openvr fixed in upstream 9.1, currently in [community-testing]. Regarding the import of VTK, what arojas said.
Comment by Antonio Rojas (arojas) - Thursday, 28 October 2021, 14:56 GMT
Projects shouldn't be using 'find_pacakge(VTK)' but rather 'find_pacakge(VTK COMPONENTS foo...)' to search only for the modules they need. In VTK9, 'find_pacakge(VTK)' searches for every single module, including their dependencies, and fails if they can't be found.

The openvr issue is an actual bug, and should be fixed with [1] - this is currently dealt with in the vtk package by a custom cmake flag, but the cmake config file is still wrong and it affects dependant packages. utf8cpp and mpi4py, on the other hand, should be found correctly if you install them at build time (they are for opencascade and freecad)

[1] https://github.com/Kitware/VTK/commit/b086e250e488a3f19243612af90d32f6671c9e0f

Loading...