cmake: searching across directories for config files #32938

issue fanquake openend 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:

     0git clone https://github.com/bitcoin/bitcoin/ bitcoin_a
     1git clone https://github.com/bitcoin/bitcoin/ bitcoin_b
     2
     3cd bitcoin_a
     4make -C depends HOST=x86_64-w64-mingw32
     5# fails to build libevent (#32707)
     6cd ../bitcoin_b
     7# fails to configure, because of the libevent config files (for a different target) in the other checkout
     8cmake -B build
     9<snip>
    10-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE
    11-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE - Failed
    12CMake Error at /Users/xxx/bitcoin_a/depends/work/build/x86_64-w64-mingw32/libevent/2.1.12-stable-f0fd46dc234/build/LibeventConfig.cmake:75 (message):
    13  Your libevent library does not contain a pthreads component!
    14
    15  The valid components are core, extra, pthreads and openssl.
    16Call Stack (most recent call first):
    17  /Users/xxx/bitcoin_a/depends/work/build/x86_64-w64-mingw32/libevent/2.1.12-stable-f0fd46dc234/build/LibeventConfig.cmake:90 (no_component_msg)
    18  cmake/module/FindLibevent.cmake:54 (find_package)
    19  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:

     0--- a/depends/patches/libevent/cmake_fixups.patch
     1+++ b/depends/patches/libevent/cmake_fixups.patch
     2@@ -7,7 +7,7 @@ cmake: set minimum version to 3.5
     3  #
     4  
     5 -cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
     6-+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
     7++cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
     8  
     9  if (POLICY CMP0054)
    10      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.

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: 2025-07-11 03:13 UTC

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