FindMPI in VTK fails if project that includes VTK specifies language to be just CXX
For context, this issue originally began in CMake: cmake/cmake#19996 (closed) but a second issue relevant to VTK in particular arose, so I opened this to address that part.
Cc: @ben.boeckel
I am trying to build a ParaView plugin against a build of ParaView 5.7 with MPI. My plugin project specifies the language to be CXX and then calls find_package(ParaView REQUIRED)
, which then fails in vtk/VTK-vtk-module-find-packages.cmake at
find_package(MPI
${_vtk_module_find_package_quiet}
${_vtk_module_find_package_required}
COMPONENTS C
OPTIONAL_COMPONENTS )
It fails because CMAKE_C_COMPILER_LOADED
is not set. The issue is:
- Should ParaView plugins be required to include
C
language even if the plugin is really onlyCXX
? or - Should VTK find the C compiler and set
CMAKE_C_COMPILER_LOADED
appropriately?
I am new(ish) to VTK, so I am unsure if VTK already addresses this by intending solution #1 above. Any input is appreciated.
Edited by Ben Boeckel