cmake: searching across directories for config files #32938

issue fanquake opened this issue on July 10, 2025
  1. fanquake commented at 11:39 AM on July 10, 2025: member

    This can be recreated on at least macOS, due to #32707.

    If there are two checkouts of the source, the build in one directory, can fail to configure, because of files in the other directory:

    git clone https://github.com/bitcoin/bitcoin/ bitcoin_a
    git clone https://github.com/bitcoin/bitcoin/ bitcoin_b
    
    cd bitcoin_a
    make -C depends HOST=x86_64-w64-mingw32
    # fails to build libevent (#32707)
    cd ../bitcoin_b
    # fails to configure, because of the libevent config files (for a different target) in the other checkout
    cmake -B build
    <snip>
    -- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE
    -- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE - Failed
    CMake Error at /Users/xxx/bitcoin_a/depends/work/build/x86_64-w64-mingw32/libevent/2.1.12-stable-f0fd46dc234/build/LibeventConfig.cmake:75 (message):
      Your libevent library does not contain a pthreads component!
    
      The valid components are core, extra, pthreads and openssl.
    Call Stack (most recent call first):
      /Users/xxx/bitcoin_a/depends/work/build/x86_64-w64-mingw32/libevent/2.1.12-stable-f0fd46dc234/build/LibeventConfig.cmake:90 (no_component_msg)
      cmake/module/FindLibevent.cmake:54 (find_package)
      CMakeLists.txt:416 (find_package)
    
  2. fanquake added the label Build system on Jul 10, 2025
  3. hebasto commented at 1:13 PM on July 10, 2025: member

    Could you please confirm whether the following patch helps:

    --- a/depends/patches/libevent/cmake_fixups.patch
    +++ b/depends/patches/libevent/cmake_fixups.patch
    @@ -7,7 +7,7 @@ cmake: set minimum version to 3.5
      #
      
     -cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
    -+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
    ++cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
      
      if (POLICY CMP0054)
          cmake_policy(SET CMP0054 NEW)
    

    ?

  4. fanquake commented at 4:24 PM on July 10, 2025: member

    That seems to fix it. I haven't tested extensively though.

  5. fanquake closed this on Jul 14, 2025

  6. fanquake referenced this in commit e72cb20c3f on Jul 14, 2025
  7. Kino1994 referenced this in commit 8b9078f03f on Jun 28, 2026
  8. BigcoinBGC referenced this in commit 703cdb95b7 on Jun 30, 2026
  9. bitcoin locked this on Jul 30, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-10 21:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me