86Box/86Box

Configure failure on CMake 3.29

Closed this issue · 2 comments

What happened?

Project fails to configure on cmake version 3.29.0. There seems to be a problem with CMakeLists.txt; copying the cmake_minimum_required and cmake_policy directives to the CMakeLists.txt files in the subdirectories gets a bit further, but there are more issues later on as well (but out of scope for this issue).

Deleting build/ does not fix the issue.

$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

$ cmake -B build/ -S src/
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Freetype: /usr/lib/libfreetype.so (found version "2.13.2")
-- Found ZLIB: /usr/lib/libz.so (found version "1.3.1")
-- Found PNG: /usr/lib/libpng.so (found version "1.6.43")
CMake Error at cpu/CMakeLists.txt:38 (target_link_libraries):
  Attempt to add link library "softfloat" to target "86Box" which is not
  built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at device/CMakeLists.txt:29 (target_link_libraries):
  Attempt to add link library "atomic" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at disk/CMakeLists.txt:26 (target_link_libraries):
  Attempt to add link library "minivhd" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
-- Checking for module 'slirp'
--   Found slirp, version 4.7.0
CMake Error at network/CMakeLists.txt:22 (target_link_libraries):
  Attempt to add link library "PkgConfig::SLIRP" to target "86Box" which is
  not built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


-- Checking for module 'freetype2'
--   Found freetype2, version 26.1.20
CMake Error at printer/CMakeLists.txt:27 (target_link_libraries):
  Attempt to add link library "PkgConfig::FREETYPE" to target "86Box" which
  is not built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


-- Checking for module 'FAudio'
--   Package 'FAudio', required by 'virtual:world', not found
CMake Error at sound/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "FAUDIO_LIBRARY-NOTFOUND" to target "86Box"
  which is not built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at sound/CMakeLists.txt:117 (target_link_libraries):
  Attempt to add link library "ymfm" to target "86Box" which is not built in
  this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at sound/CMakeLists.txt:129 (target_link_libraries):
  Attempt to add link library "resid-fp" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Error at unix/CMakeLists.txt:28 (target_link_libraries):
  Attempt to add link library "Threads::Threads" to target "86Box" which is
  not built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.29)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Configuration file

(none)

Operating system

Arch Linux

CPU

AMD, but irrelevant for issue

86Box version

86c6cc2

Build architecture

Linux - x64 (64-bit)

Build type

  • New recompiler
  • Debug build

Download source

Official website (Jenkins, GitHub)

Additional context

No response

Use -S . instead of -S src/.

Yeah, that solves it. It seems I got confused when reading the documentation. Thanks