c++ - 在Cmake中构建Assimp时出错

标签 c++ visual-studio cmake assimp

您好,我正在尝试使用 Cmake 构建 Assimp,但每次尝试配置 Assimp 时都会出现以下错误消息。 Cmake的版本是3.11.0,assimp的版本是4.0.0。

Looking for DirectX...
DirectX_PREFIX_PATH changed.
Found DirectX: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86/d3d9.lib
DX lib dir: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86
Looking for ZLIB...
Found PkgConfig: C:/cygwin/bin/pkg-config.exe (found version "0.29.1") 
Checking for module 'zzip-zlib-config'
  No package 'zzip-zlib-config' found
Could not locate ZLIB
compiling zlib from sources
CMake Deprecation Warning at contrib/zlib/CMakeLists.txt:8 (cmake_policy):
  The OLD behavior for policy CMP0048 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of off64_t
Check size of off64_t - failed
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Could NOT find rt (missing: RT_LIBRARY) 
Enabled formats: AMF 3DS AC ASE ASSBIN ASSXML B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
Disabled formats:
Looking for DirectX...
DirectX_PREFIX_PATH changed.
DX lib dir: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86
Could NOT find IL (missing: IL_LIBRARIES IL_INCLUDE_DIR) 
CMake Error at C:/cygwin/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:27 (message):
  The imported target "Qt5::Gui" references the file

     "C:/cygwin/include/qt5/"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "C:/cygwin/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  C:/cygwin/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:68 (_qt5_Gui_check_file_exists)
  C:/cygwin/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  tools/assimp_qt_viewer/CMakeLists.txt:19 (FIND_PACKAGE)


Configuring incomplete, errors occurred!
See also "C:/Users/peter/Desktop/assimp-master/assimp-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/peter/Desktop/assimp-master/assimp-master/build/CMakeFiles/CMakeError.log".

对于配置生成器,我使用了 Visual Studio 15 2017,因为我将其用于我的 IDE。有什么办法可以解决这个问题吗?

最佳答案

请尝试最新版本的assimp(4.1.0)。 cygwin-cmake 文件已损坏。这适用于最新版本。

作为一种解决方法,禁用 assimp 的工具支持(将构建库,但不会构建基于 qt5 的查看器):

cmake CMakelists.txt -DASSIMP_BUILD_ASSIMP_TOOLS=OFF

这将修复您的 cmake 错误,因为这些工具不会受到 cmake 的影响。

关于c++ - 在Cmake中构建Assimp时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51668205/

相关文章:

c++ - 如何在可能是任何类的属性的 void 函数上创建 typedef?

c++ - 在 Clion CMake 中包含 Eigen 库时出现问题

c - 我应该在 CLion 中包含哪个库才能启用 readline

cmake - CMake没有获取链接库的INTERFACE_INCLUDE_DIRECTORIES

c++ - 获取模板中数组最小值的函数

c++ - 清理 DirectX 应用程序时崩溃

visual-studio - 如何在 VS2005 中展开所有折叠的代码区域

visual-studio - FxCop 构建 (Visual Studio 2008 Professional)

C++ Builder DBGrid 在 xlsx 文件中导出到 Excel

c++ - C++ 编译器是否优化掉未使用的#includes?