From 65129d7b902b4e7589bdc8dd0540d22fd35870c0 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 14 May 2018 17:04:18 +0100 Subject: [PATCH] CONFIG: export ThirdParty Qt5_DIR (issue #827) --- etc/config.csh/example/paraview | 7 ++++--- etc/config.csh/paraview | 8 ++++++++ etc/config.csh/unset | 1 + etc/config.sh/example/paraview | 7 ++++--- etc/config.sh/paraview | 8 +++++++- etc/config.sh/unset | 7 ++++++- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/etc/config.csh/example/paraview b/etc/config.csh/example/paraview index 98d7ad3cd8..d2c0ba0b14 100644 --- a/etc/config.csh/example/paraview +++ b/etc/config.csh/example/paraview @@ -13,8 +13,8 @@ # config.csh/example/paraview # # Description -# Example of defining a different ParaView_VERSION but retaining -# the standard config.csh/paraview mechanism +# Example of defining a different ParaView_VERSION but retaining the +# standard config.csh/paraview mechanism # # Note # This file could be copied to a user or site location, but should never @@ -25,7 +25,8 @@ set pv=5.5.0 set pv=5.5.0-mpipy +set qt=qt-5.9.0 -eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=$pv` +eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=$pv ParaView_QT=$qt` #------------------------------------------------------------------------------ diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview index c3710b59fe..19239e6980 100644 --- a/etc/config.csh/paraview +++ b/etc/config.csh/paraview @@ -120,8 +120,16 @@ if ( $?ParaView_VERSION ) then #OBSOLETE? endif # QT libraries as required + # Set Qt5_DIR to root directory. + # Another possibility: "qtpaths --qt-version" + set qtDir="$archDir/$ParaView_QT" if ( -d "$qtDir" ) then + switch ($ParaView_QT) + case *-qt*: + setenv Qt5_DIR $qtDir + breaksw + endsw foreach qtLibDir ("$qtDir/lib$WM_COMPILER_LIB_ARCH" "$qtDir/lib") if ( -d "$qtLibDir" ) then setenv LD_LIBRARY_PATH "${qtLibDir}:${LD_LIBRARY_PATH}" diff --git a/etc/config.csh/unset b/etc/config.csh/unset index 9d4a22b6b6..92cef08d00 100644 --- a/etc/config.csh/unset +++ b/etc/config.csh/unset @@ -111,6 +111,7 @@ unsetenv ParaView_INCLUDE_DIR unsetenv ParaView_VERSION unsetenv PV_PLUGIN_PATH unsetenv VTK_DIR +unsetenv Qt5_DIR # Perhaps only unset if it is in WM_THIRD_PARTY_DIR? #------------------------------------------------------------------------------ # Unset other ThirdParty environment variables diff --git a/etc/config.sh/example/paraview b/etc/config.sh/example/paraview index c1526e8c54..fb91cc1699 100644 --- a/etc/config.sh/example/paraview +++ b/etc/config.sh/example/paraview @@ -13,8 +13,8 @@ # config.sh/example/paraview # # Description -# Example of defining a different ParaView_VERSION but retaining -# the standard config.sh/paraview mechanism +# Example of defining a different ParaView_VERSION but retaining the +# standard config.sh/paraview mechanism # # Note # This file could be copied to a user or site location, but should never @@ -25,7 +25,8 @@ pv=5.5.0 pv=5.5.0-mpipy +qt=qt-5.9.0 -eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=$pv) +eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=$pv ParaView_QT=$qt) #------------------------------------------------------------------------------ diff --git a/etc/config.sh/paraview b/etc/config.sh/paraview index 553378c472..33a8b32755 100644 --- a/etc/config.sh/paraview +++ b/etc/config.sh/paraview @@ -127,10 +127,16 @@ then #OBSOLETE? export PYTHONPATH=$PYTHONPATH:${PYTHONPATH:+:}$pvPython:$pvLibDir #OBSOLETE? fi - # QT libraries as required + # QT libraries as required, and Qt5_DIR for the root directory. + # Another possibility: "qtpaths --qt-version" qtDir="$archDir/$ParaView_QT" if [ -d "$qtDir" ] then + case "$ParaView_QT" in + *-5*) + export Qt5_DIR=$qtDir + ;; + esac for qtLibDir in $qtDir/lib$WM_COMPILER_LIB_ARCH $qtDir/lib do if [ -d "$qtLibDir" ] diff --git a/etc/config.sh/unset b/etc/config.sh/unset index 024ba63160..09aa585579 100644 --- a/etc/config.sh/unset +++ b/etc/config.sh/unset @@ -97,7 +97,6 @@ then unset OPAL_PREFIX fi - #------------------------------------------------------------------------------ # Unset Ensight/ParaView-related environment variables @@ -108,6 +107,12 @@ unset ParaView_VERSION unset PV_PLUGIN_PATH unset VTK_DIR +# Undefine Qt5_DIR if set to one of the paths on foamOldDirs +if [ -z "$($foamClean -env=Qt5_DIR "$foamOldDirs")" ] +then + unset Qt5_DIR +fi + #------------------------------------------------------------------------------ # Unset other ThirdParty environment variables