0

我正在尝试按照此页面上的说明在 ubuntu 20.10 上编译 Liquidfun 1.10:https ://google.github.io/liquidfun/Building/html/md__building_linux.html

当我运行命令时:

cd liquidfun/Box2D
cmake -G'Unix Makefiles'
make

我收到各种错误并且构建失败。这是屏幕输出:

cmake -G'Unix Makefiles'
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:120 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::X11


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::ICE


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::SM


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xau


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xcursor


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xdmcp


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xext


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xxf86vm


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xfixes


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xi


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xinerama


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xkb


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xmu


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xpm


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xrandr


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xrender


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xss


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xt


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xutil


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xv


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Threads::Threads


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Threads::Threads


-- Configuring incomplete, errors occurred!

还有其他人遇到这个问题吗?

任何帮助表示赞赏

4

1 回答 1

0

add_library他们通过重新定义命令来玩肮脏的游戏: liquidfun/Box2D/CMakeLists.txt:101。他们似乎忘记了某些FindXXX.cmake脚本可能会使用 this 创建 IMPORTED 目标add_library

您可以尝试删除此重新定义:从function(add_library name)until中删除行endfunction(add_library)。但要准备好在未记录的位置创建一些库。

无论如何,这是项目中的一个错误,因此可以(应该)向开发人员报告。


为了克服警告“未提供源或二进制目录”。.向 cmake 调用添加参数:

cmake -G'Unix Makefiles' .

此参数将指定一个源目录,在源内构建的情况下,该目录与构建目录相同。(虽然 CMake 不鼓励源内构建而不是源外构建,但某些项目仅支持源内构建)。

于 2020-12-07T12:14:09.240 回答