c++ - CMake:OGREConfig.cmake
问题描述
我有一个奇怪的问题,似乎很少有人使用 Ogre3D,CMake 无法找到(呃,“接受”)OGREConfig.cmake。这是我的控制台输出:
CMake Error at CMakeLists.txt:10 (find_package):
Could not find a configuration file for package "OGRE" that is compatible
with requested version "1.12.7".
The following configuration files were considered but not accepted:
D:/_lib/ogre/build/sdk/CMake/OGREConfig.cmake, version: 1.12.7 (64bit)
我不知道我是不是傻子还是什么,但我确保在环境变量中设置了 OGRE_DIR ,我什至按照 T 的说明从源代码构建了 Ogre。这是我的 CMakeLists.txt 项目:
cmake_minimum_required(VERSION 3.17.2)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
project(OgreProject1 VERSION 0.0.1 LANGUAGES C CXX)
# specify which version and components you need
find_package(
OGRE 1.12.7
COMPONENTS
Bites
RTShaderSystem
REQUIRED
)
# copy resource.cfg next to our binaries where OGRE looks for it
file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# add the source files as usual
add_executable(cmake-good src/main.cpp)
# this also sets the includes and pulls third party dependencies
target_link_libraries(cmake-good OgreBites OgreRTShaderSystem)
这似乎是一个“我”的问题,而不是一个“食人魔”的问题,所以如果你能让我朝着正确的方向前进,那就太好了。如果出现提示,我将使用更多信息编辑我的帖子。
注意:如果重要的话,我用 MSVC16 构建了 Ogre,我的 CMake 版本是 3.17.2。
解决方案
推荐阅读
- node.js - 快速路线在本地工作但不适用于生产
- php - 如何在 woocommece pdf invoices 插件中打印订购的产品图像
- python - 如何解决:AttributeError: 'FunctionInfo' 对象在 pydriller 中没有属性 'fan_in' 错误?
- html - 与电子邮件中的文本颜色不同的换行
- typescript - 为什么在 TypeScript 中通过索引访问的数组元素的类型中没有“未定义”?
- react-native - react-navigation useLinkTo 在屏幕外但在 NavigationContainer 内
- c++ - C ++无法使用堆栈模板调用函数
- typescript - 将 Redux Toolkit 与 Typescript 一起使用时,我应该为常规的“无负载”操作使用什么类型?
- python - 如何在keras的最后一层输入单个变量?
- urlencode - 在后续请求中使用之前对字符串进行 URL 编码 (Gatling)