Error Compiling google liquidfun on Linux Ubuntu

362 Views Asked by At

I'm trying to compile Liquidfun 1.10 on ubuntu 20.10 following the instructions on the this page: https://google.github.io/liquidfun/Building/html/md__building_linux.html

When I run the command:

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

I get various error and the build fails. This is the screen output:

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!

Anyone else run into this problem?

Any help is appreciated

1

There are 1 best solutions below

3
On

They play dirty games with redefinition of add_library command: liquidfun/Box2D/CMakeLists.txt:101. And they seems to forget that some FindXXX.cmake scripts may create IMPORTED target using exactly this add_library.

You could try to remove this redefinition: remove the lines from function(add_library name) till endfunction(add_library). But be ready that some libraries will be created in the non-documented locations.

In any case, this is a bug in the project, so it could(should) be reported to the developers.


For overcome the warning "No source or binary directory provided." add . parameter to cmake invocation:

cmake -G'Unix Makefiles' .

This parameter would specify a source directory, which is same to the build directory in case of in-source builds. (While CMake discourages in-source builds in preference to out-of-source builds, some projects supports only in-source ones).