1

I’m researching making a Qt-based desktop application to use Paraview framework and make a simpler ParaView GUI. The documentation says that there are some examples here

https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications

In ParaView forum I read this

First, you need to build ParaView.

Then, choose one of the subfolder you points out: there all are independent examples. Build it in a new build directory. You will need to specify the path to the ParaView build directory in CMake with ParaView_DIR.

I build ParaView but I don't undestand this part You will need to specify the path to the ParaView build directory in CMake with ParaView_DIR.

Here is my structure

dev
  |- pv
  |    |- build
  |    |- paraview-superbuild
  |
  |
  |- qt-examples
       |- one
          |- build
          |- Clone1

How do I add the path?

I tried adding set(ParaView_DIR /Users/username/Desktop/dev/pv/build) at the beginning of CMakeLists.txt of Clone1 and then I executed cmake ../Clone1 from the build folder.

But got the error

CMake Error at CMakeLists.txt:6 (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.


-- Configuring incomplete, errors occurred!

What do I need to do?

alo gon
  • 79
  • 3
  • 7
  • Does the `ParaViewConfig.cmake` or `paraview-config.cmake` from the error message exist in `/Users/username/Desktop/dev/pv/build`? – drescherjm Nov 25 '19 at 13:51
  • cross posted from https://discourse.paraview.org/t/executing-custom-applications-examples/3015/5, where discussion is going on – Nico Vuaille Nov 25 '19 at 13:56
  • You might have to do `make install` in your paraview build dir, and then pass the installation directory to cmake, like `cmake -DParaView_DIR=/path/to/paraview-install` – Frank Osterfeld Nov 25 '19 at 14:07

1 Answers1

1

Well, the error message says all you need to do. You need to set the variable CMAKE_PREFIX_PATH pointing to the path of your build. This can be done in the cmake command line argument when building one of the examples:

cmake -DCMAKE_PREFIX_PATH=/Users/username/Desktop/dev/pv/build

As you are trying to build Qt programs, you may want to set also the prefix path to your Qt libraries. CMAKE_PREFIX_PATH is a semicolon separated list of paths:

cmake -DCMAKE_PREFIX_PATH=/Users/username/Desktop/dev/pv/build;/Users/username/Qt/5.12.5/gcc_64
Former contributor
  • 2,466
  • 2
  • 10
  • 15
  • I find cleaner using `_DIR` (or `_ROOT` since cmake 3.12, see https://cmake.org/cmake/help/v3.16/variable/PackageName_ROOT.html#variable:_ROOT) as suggested by the cmake output. `CMAKE_PREFIX_PATH` is some kind of global variable that can have side effects . – Nico Vuaille Nov 26 '19 at 09:37