mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.55k stars 1.29k forks source link

Build instructions in README.md on Ubuntu 20.04.6 don't work #12325

Open meschi opened 1 year ago

meschi commented 1 year ago

Bug Description

I used the build instructions from the readme file:

$ cd mixxx
$ source tools/debian_buildenv.sh setup
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

cmake .. causes this error:

CMake Error at CMakeLists.txt:2112 (find_package):
  Could not find a package configuration file provided by "GTest" with any of
  the following names:

    GTestConfig.cmake
    gtest-config.cmake

  Add the installation prefix of "GTest" to CMAKE_PREFIX_PATH or set
  "GTest_DIR" to a directory containing one of the above files.  If "GTest"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!

Version

2.4

OS

Ubuntu 20.04.6 LTS

ronso0 commented 1 year ago

Does source tools/debian_buildenv.sh setup succeed, i.e. no errors about packages not being found?

Can you install Gtest with apt?

meschi commented 1 year ago
  1. Yes
  2. libgtest-dev is already installed

The file /usr/share/cmake-3.16/Modules/FindGTest.cmake exists.

ronso0 commented 1 year ago

I'm not sure how /usr/share/cmake-3.16/Modules/FindGTest.cmake is relevant? Please check if libgtest-dev installed one of the files mentioned in the cmake output, GTestConfig.cmake or gtest-config.cmake, for example with this command dpkg -L libgtest-dev | grep cmake

ronso0 commented 10 months ago

Confirmed, ran into this when I reverted to 20.04 default build env. Gtest packages of 20.04 don't provide a cmake config, that was introduced with the versions available in 22.04

So IIUC building with 20.04 (default packages) is not possible currently.

Two ways to "fix" it:

  1. (the way I build) install gtest packages from Ubuntu 22.04, for example googletest_1.11.0-3_all.deb libgmock-dev_1.11.0-3_amd64.deb libgtest-dev_1.11.0-3_amd64.deb (there are newer versions) Downside: these versions require a newer libc version, so the Mixxx tests can't be built with it. I also have a newer gcc verion, don't remember if I had to get that because of the newer gtest packages. You'll find out...
  2. use Mixxx' vcpkg for building (newer tried that, best ask on Mixxx Zulip for help)