Follow-up from "Fix paraview-config script"
The following discussion from !3939 (merged) should be addressed:
@dalcinl started a discussion: (+2 comments)
What was not working with the previous syntax @dalcinl ?
@mwestphal I have a makefile using
paraview-configto get compiler and linker flags to build a Catalyst adaptor. The linker flags had all the VTK stuff, but the ParaView stuff was missing. After inspecting the actual sources, the issue was rather obvious, the
ParaView_LIBRARIESvariable was misspelled.
BTW, this new
paraview-configscript requires a bit more of work, right now is is a bit hard to use. For example, if I run it with no args:
$ catalyst/bin/paraview-config CMake Error at CMakeLists.txt:5 (find_package): By not providing "FindParaView.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ParaView", but CMake did not find one. Could not find a package configuration file provided by "ParaView" with any of the following names: ParaViewConfig.cmake paraview-config.cmake Add the installation prefix of "ParaView" to CMAKE_PREFIX_PATH or set "ParaView_DIR" to a directory containing one of the above files. If "ParaView" provides a separate development package or SDK, be sure it has been installed. Traceback (most recent call last): File "catalyst/bin/paraview-config", line 254, in <module> vtk_components=opts.vtk_components) File "catalyst/bin/paraview-config", line 161, in extract_paraview_flags stdout=stdout) File "/usr/lib64/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '-GUnix Makefiles', '/tmp/tmpmfpmutdc/src']' returned non-zero exit status 1.
There are to obvious issues here:
- If running with no cmdline args is not allowed (should it?), this should print help (to stderr) and exit (with error) rather than getting the output above.
- The path to
paraview-config.cmakeshould default to the one where the file is installed. This should be easy to implement with CMake's
@variable@substitution. Asking the user to pass the path with
-p -p <PARAVIEW-ROOT-DIR>/lib/cmake/paraview-X.Yis cumbersome, you need to know
X.Yin advance or implement more hackery like resolving the root dir from the path of the config script.