Skip to content

Commit

Permalink
Fix paraview version finding
Browse files Browse the repository at this point in the history
Disables reading out paraview enviroment variables. However, whatever we were
trying to do is undocumented as far as I can tell.
  • Loading branch information
nilsdeppe committed Apr 10, 2024
1 parent 674ebef commit ff369f3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cmake/FindParaView.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ if (PVPYTHON_EXEC)
ERROR_STRIP_TRAILING_WHITESPACE)
string(REPLACE "\n" ";" _OUTPUT "${_OUTPUT}")
list(LENGTH _OUTPUT _OUTPUT_LENGTH)
if (_OUTPUT_LENGTH EQUAL 1)
# '--print' is not supported, just get the version
list(GET _OUTPUT 0 PARAVIEW_VERSION)
elseif(_OUTPUT_LENGTH EQUAL 2)
# '--print' is supported, get the version and environment variables
list(GET _OUTPUT 0 PARAVIEW_PYTHON_ENV_VARS)
list(GET _OUTPUT 1 PARAVIEW_VERSION)
endif()
foreach(_ENTRY ${_OUTPUT})
string(FIND "${_ENTRY}" "paraview version " _VERSION_FOUND)
if(NOT ${_VERSION_FOUND} EQUAL -1)
set(PARAVIEW_VERSION ${_ENTRY})
endif()
# Note: we used to set PARAVIEW_PYTHON_ENV_VARS if an entry in the list
# wasn't the version.This doesn't work because if you run pvpython
# without a mpirun on an mpi build of paraview then you get additional
# output that isn't environment variables. We need a separate way of
# handling whatever --print does. However, I (Nils Deppe) can't find this
# flag as documented.
endforeach()
string(REPLACE "paraview version " "" PARAVIEW_VERSION "${PARAVIEW_VERSION}")
endif()

Expand Down

0 comments on commit ff369f3

Please sign in to comment.