Commit 3d0af964 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

paraview: fix default version detection

Use the right default version based on the selection made. For git
clones, use the latest version number because we can only guess at what
it will be. For source directories, introspection will give us an exact
answer in case it is a git repo and a best-guess via `version.txt`
otherwise. Other source selections are version numbers and should be
used as-is.
parent 70acff92
Pipeline #37538 passed with stage
......@@ -8,14 +8,21 @@ list(INSERT CMAKE_MODULE_PATH 0
macro (superbuild_setup_variables)
include(SuperbuildVersionMacros)
if (paraview_SOURCE_SELECTION STREQUAL "git")
set(PARAVIEW_VERSION_DEFAULT "5.2.0-RC4" CACHE STRING
"The default version of ParaView to use if it can't be auto-determined")
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set(PARAVIEW_VERSION_DEFAULT "5.2.0"
CACHE STRING "The default version of ParaView to use if it cannot be detected")
mark_as_advanced(PARAVIEW_VERSION_DEFAULT)
set(paraview_default_version "${PARAVIEW_VERSION_DEFAULT}")
elseif (paraview_SOURCE_SELECTION STREQUAL "source")
# If it is a git repo, we'll get it that way, otherwise we will look at the
# `version.txt` in the checkout.
set(paraview_default_version "")
else ()
set(PARAVIEW_VERSION_DEFAULT "${paraview_SOURCE_SELECTION}" CACHE STRING
"The default version of ParaView to use if it can't be auto-determined")
# The selection is the version number; use it.
set(paraview_default_version "${paraview_SOURCE_SELECTION}")
endif()
mark_as_advanced(PARAVIEW_VERSION_DEFAULT)
superbuild_set_version_variables(paraview "${PARAVIEW_VERSION_DEFAULT}" "paraview-version.cmake")
superbuild_set_version_variables(paraview "${paraview_default_version}" "paraview-version.cmake" "version.txt")
set(paraview_version "${paraview_version_major}.${paraview_version_minor}")
endmacro ()
......
......@@ -57,6 +57,10 @@ superbuild_set_revision(paraviewtutorialdata
URL "http://www.paraview.org/files/data/ParaViewTutorialData.tar.gz"
URL_MD5 ff7ceab8cfc674b227c0bba392d1ed3c)
# Other than the `git` and `source` selections, the name of the selection
# should be the version number of the selection. See
# `superbuild_setup_variables` in `CMakeLists.txt` for the logic which relies
# on this assumption.
superbuild_set_selectable_source(paraview
SELECT 5.2.0 DEFAULT
URL "http://www.paraview.org/files/v5.2/ParaView-v5.2.0.tar.gz"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment