从ParaView构建自定义Qt应用示例时出错

问题描述 投票:1回答:1

我正在研究制作一个基于Qt的桌面应用程序,以使用Paraview框架并制作一个更简单的ParaView GUI。文档说这里有一些例子

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

在ParaView论坛中,我读了此

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.

我构建了ParaView,但我不理解这部分You will need to specify the path to the ParaView build directory in CMake with ParaView_DIR.

这是我的结构

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

如何添加路径?

[我尝试在Clone1的set(ParaView_DIR /Users/username/Desktop/dev/pv/build)的开头添加CMakeLists.txt,然后从构建文件夹中执行了cmake ../Clone1

但是得到了错误

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!

我需要做什么?

c++ qt cmake paraview
1个回答
1
投票

嗯,错误消息说明了您需要做的所有事情。您需要设置指向构建路径的变量CMAKE_PREFIX_PATH。在构建示例之一时,可以在cmake命令行参数中完成此操作:

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

当您尝试构建Qt程序时,您可能还希望设置Qt库的前缀路径。 CMAKE_PREFIX_PATH是用分号分隔的路径列表:

cmake -DCMAKE_PREFIX_PATH=/Users/username/Desktop/dev/pv/build;/Users/username/Qt/5.12.5/gcc_64
© www.soinside.com 2019 - 2024. All rights reserved.