| Summary: | Geant4Config.cmake missing C support with VTK | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Stephan Lachnit <stephan.lachnit> |
| Component: | cmake | Assignee: | Ben Morgan <Ben.Morgan> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P4 | ||
| Version: | 11.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | Patch to fix the issue | ||
I'm using Debian Sid, building Geant4 11.0.1 with VTK 9.1.0 (9.1.0+really9.1.0+dfsg2-3+b2) I would suspect this is an issue with the VTK config file - the only thing that might be from the Geant4 side is to limit the VTK components requested (we don't use MPI, so possible this can be fixed by only declaring what we must have in find_dependency(VTK)). I don't think the correct fix is an enable_language(C) in the config file. That should be determined by the dependency or calling project. (In reply to Ben Morgan from comment #2) > I would suspect this is an issue with the VTK config file - the only thing > that might be from the Geant4 side is to limit the VTK components requested > (we don't use MPI, so possible this can be fixed by only declaring what we > must have in find_dependency(VTK)). Thanks for the reply! Could you add such a declaration? Sorry for the delay here - we're reviewing what parts of VTK Geant4 requires and whether that impacts what is refound in Geant4Config.cmake. We'll have a solution in time for the 11.1 release, and should be backport-able to earlier versions. It seems like this has been resolved in Vtk, the problem does not appear anymore. |
Created attachment 765 [details] Patch to fix the issue When building with VTK, including Geant4 via CMake fails with the following error: CMake Error at /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/VTK-targets.cmake:518 (set_target_properties): The link interface of target "VTK::mpi" contains: MPI::MPI_C but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/vtk-config.cmake:138 (include) /usr/share/cmake-3.23/Modules/CMakeFindDependencyMacro.cmake:47 (find_package) /usr/lib/x86_64-linux-gnu/Geant4-11.0.1/Geant4Config.cmake:594 (find_dependency) src/tools/geant4/CMakeLists.txt:13 (FIND_PACKAGE) This can be fixed by adding enable_language(C) in Geant4Config.cmake, I attached a patch with this fix. However I'm not an expert at CMake and I'm not entirely sure if this is a problem with Geant4 or a bug in the VTK CMake config.