Make PDF installation location configurable
From @cwilling:
Could the location for PDF's (currently tasked above to be /share/paraview-$version) be made configurable please? By all means make /share/paraview-$version the default location but the ability to set an alternate location would be appreciated.
At the moment (5.5.0) it seems to be hard coded to a doc directory in ParaViewCore/ClientServerCore/Default/vtkPVFileInformation.cxx
std::string vtkPVFileInformation::GetParaViewDocDirectory()
{
return vtkPVFileInformation::GetParaViewSharedResourcesDirectory() + "/doc";
}
which I'm patching locally to achieve the desired location.
For instance, I see that VTK_INSTALL_DOC_DIR is already set (to "share/doc/paraview-${PARAVIEW_VERSION}") in the main CmakeLists.txt. That could be made use of by adding: #define VTK_INSTALL_DOC_DIR "@VTK_INSTALL_DOC_DIR@" into the vtkPVConfig.h.in file. After configuration/generation, the expanded #define is left in vtkPVConfig.h from where it could be used directly in vtkPVFileInformation.cxx - something like:
std::string vtkPVFileInformation::GetParaViewDocDirectory()
{
return "/usr/" + VTK_INSTALL_DOC_DIR ;
}
works for me since I can set my own VTK_INSTALL_DOC_DIR when running cmake.
There's probably a function to find the CMAKE_INSTALL_PREFIX (I'm not familiar enough with the codebase) but this works for me without that function because I can set my own VTK_INSTALL_DOC_DIR to the absolute path of the desired directory when running cmake.
Would you entertain the idea of it containing a move of the pdf's from VTK_INSTALL_DATA_DIR (/share/paraview-version/doc) to VTK_INSTALL_DOC_DIR (/share/doc/paraview-
version)? That's on the basis that these (GettingStarted, Guide & Tutorial) are really application documentation rather than application data.
I also have a related suggestion - at the moment only the GettingStarted document is accessed from the local file system (in Qt/ApplicationComponents/pqParaViewMenuBuilders.cxx) whereas the Guide & Tutorial are downloaded from the network. I'd like to change that to use local versions in all cases, perhaps falling back to network download if there's no local version. The relevance to the other change is the setting of documentationPath by a call to vtkPVFileInformation::GetParaViewDocDirectory().c_str() - GetParaViewDocDirectory() is where other changes would happen.
Would you prefer separate merge requests or a single combined one?
BTW (to further support location change of pdf's to VTK_INSTALL_DOC_DIR) note use of the variable name documentationPath (in pqParaViewMenuBuilders.cxx) and call to function GetParaViewDocDirectory() (in vtkPVFileInformation.cxx) which currently returns location of the data directory (not the documentation directory).
@wascott responded:
@cwilling We actually just changed the Guide and Tutorial to be web based, since the Guide and Tutorial aren't necessarily updated on the same schedule as ParaView. Thus, for example, we can update the Tutorial (which is given in November for SuperComputing) in October, and users will automagically see these updates. We also don't need to hold up releasing ParaView for these documents. Not saying this is the right thing to do, but that was the reason we moved to web based documentation, linked from the Help menu.
@cwilling responded:
OK, I understand the reasoning but I'll still patch my local builds to use local documentation (which I much prefer) and update it whenever I become aware of newer documentation. It would be good if the ParaViewTutorial.pdf could have version information in its name. Then I could extend my script which checks for new Paraview versions to also look for updated tutorials.