thliebig / openEMS

openEMS is a free and open-source electromagnetic field solver using the EC-FDTD method.
http://openEMS.de
GNU General Public License v3.0
459 stars 156 forks source link

Fix VTK Deprecation Warning in CMake #162

Closed biergaizi closed 3 days ago

biergaizi commented 4 days ago

This PR contains two changes.

CMakeLists.txt: avoid deprecated names in VTK 9+.

In VTK 9+, components vtkIOXML, vtkIOGeometry, vtkIOLegacy, vtkIOPLY, etc, have been renamed to IOXML, IOGeometry, IOLegacy, IOPLY, etc. So use the new name if VTK 9+ is detected.

CMakeLists.txt: don't call VTK_USE_FILE for 9.0+

The VTK_USE_FILE is no longer used starting with 8.90.

thliebig commented 3 days ago

Hmmpf, I should have not just reviewed but tested it. cmake does not like this for me... I will have a look

thliebig commented 3 days ago

This is one of the reasons I try to never mess with cmake... it is just purely fractal and you just cannot test it on all possible machines and setups...

If anybode has a good idea how to replace cmake let me know !

thliebig commented 3 days ago

find_package(VTK)

This line works for me....as soon as you add "required" nothing works anymore even though it is found just fine... I HATE cmake and I do not know why vtk is such a pain with cmake?

biergaizi commented 3 days ago

Which system did you test this on? I might be able to look into it using a chroot container...

thliebig commented 3 days ago

Manjaro Linux... maybe we just use the "find_package(VTK)" and be done with it (for now)?

biergaizi commented 3 days ago

Manjaro Linux

Aha, one of my test machines runs ArchLinux, and yes, I'm able to see the problem. Yes, just use find_package(VTK) for now should be okay. Are you going to commit it yourself, or should I open a new PR?

thliebig commented 3 days ago

No I just wanted to maybe confirm with you that the change is working for you too... I will fix it...