c++ - 从 ParaView 构建自定义 Qt 应用程序示例时出错
问题描述
我正在研究制作一个基于 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
如何添加路径?
我尝试在 Clone1set(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!
我需要做什么?
解决方案
好吧,错误消息说明了您需要做的所有事情。您需要设置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
推荐阅读
- ios - 如何将数据从表格视图单元格传输到视图控制器
- vim - MacOS Solarized Color-scheme 在终端 VIM 中不起作用
- sql-server - Case When Result 中的表达式
- android - 活动中有很多框架布局
- selenium - 使用 selenium java 3.11 库编译代码时出现“错误:无法访问 Killable”
- python - ElementTree XPath - 获取所有标签
- android - 在 Fragment 中创建相机预览
- python - Pandas:使用基于不同 DF 的自定义列创建 DF
- induction - Dafny 归纳引理:不能推断归纳假设的后置条件
- android - 如何检查是否创建了 Intent