cmake - 构建 assimp 3.2 不再工作

标签 cmake makefile googletest assimp

我无法再构建 assimp 3.2。昨天有效,但今天无效。

我正在从 here 下载 assimp .然后我按照 INSTALL 文件中的描述执行 cmake CMakeLists.txt -G 'Unix Makefiles'make 。但是,在执行 make 时出现以下错误:

[ 84%] Performing configure step for 'gtest'
CMake Error at /home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest-stamp/gtest-configure.cmake:16 (message):
  Command failed: 1

   '/usr/bin/cmake' '-DCMAKE_BUILD_TYPE=' '-Dgtest_force_shared_crt=ON' '-Dgtest_disable_pthreads:BOOL=OFF' '-GUnix Makefiles' '/home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest'

  See also

    /home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest-stamp/gtest-configure-*.log



make[2]: *** [test/gtest/src/gtest-stamp/gtest-configure] Error 1

gtest-configure-out.log 是空的,但是 gtest-configure-err.log 说了以下内容:

CMake Error: The source directory "/home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest" does not appear to contain CMakeLists.txt.

有什么想法吗?昨天它成功了,我没有在全局范围内更改我的系统上的任何内容。

编辑:

我可以使用添加到 cmake 命令的选项 -DASSIMP_BUILD_TESTS=OFF 来构建它。然而,这只是一种解决方法,并不能解释问题。

最佳答案

因为项目 assimp 使用了不正确的 gtest 存储库链接

当前 cmake-modules/AddGTest.cmake二手 link到已弃用的 chromium 存储库,并从中删除了所有代码。

来自 README.md

This mirror has been deprecated. 
The actual repository has moved to https://github.com/google/googletest/ 

因此您应该更新 AddGTest.cmake 中的链接以指向 Github 存储库。

更新:

拉取请求已经合并到 assimp 的主分支中。因此,请使用它而不是来自评论的存储库。

关于cmake - 构建 assimp 3.2 不再工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35219589/

相关文章:

linux - Cmake 设置安装路径 --/usr/local/bin

c - 在 Makefile 中运行 unix 命令以解析文本并将其传递给链接行作为定义 -D

cmake - Cmake 中的两组测试

c++ - 如何在不安装的情况下将 opencv 源文件包含为 cmake 依赖项?

c++ - CMake 无法从子文件夹中找到包含文件

c++ - 在 Linux/Ubuntu 中编译 openCV 应用程序时如何解决 undefined reference cv :. ...

makefile - 如何修改隐式GNUMake规则来编译文件?

c++ - 带有 gtest 框架的 Spdlog 记录器无法工作

c++ - 如何在 Googletest 框架的多个测试中使用 "configurations"的全局变量

c++ - 为了模拟对象,我们是否应该将所有成员函数声明为虚拟(C++)?