cmake: Introduce packages #96

pull hebasto wants to merge 6 commits into bitcoin-core:master from hebasto:240316-pack changing 6 files +151 −165
  1. hebasto commented at 4:10 PM on March 16, 2024: member

    This PR adds configurations for the Libmultiprocess and LibmultiprocessGen packages.

    The Bitcoin Core branch, with uses this PR branch, is available here.

    As a suggestion for a follow-up, it seems worth disabling mpgen target for cross-compiling (see https://github.com/bitcoin/bitcoin/pull/29665#issuecomment-2002027957 and CMake docs).

    Based on https://github.com/chaincodelabs/libmultiprocess/pull/95.

  2. ryanofsky assigned ryanofsky on Mar 19, 2024
  3. ryanofsky commented at 4:57 PM on March 19, 2024: collaborator

    Looks nice! Will review this. I remembered you also posted a proof of concept branch defining packages last year in https://github.com/chaincodelabs/libmultiprocess/pull/79#issuecomment-1407430661 that I guess this supercedes?

  4. hebasto commented at 5:01 PM on March 19, 2024: member

    I remembered you also posted a proof of concept branch defining packages last year in #79 (comment) that I guess this supercedes?

    Yes, it does.

  5. cmake: Add `LibmultiprocessMacros` module
    Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
    d9ec22f81b
  6. cmake, refactor: Use `target_capnp_sources` for `mptest` target bd2dfe27b0
  7. cmake, refactor: Use `target_capnp_sources` for examples 66643d8eaa
  8. cmake: Configure `Libmultiprocess` package 3b20e35ab8
  9. cmake: Configure `LibmultiprocessGen` package 694b6b13e9
  10. cmake, refactor: Rename target export files
    The `<Package>Targets` pattern is widely used and does not cause
    confusion.
    4e70ad4719
  11. hebasto force-pushed on Mar 29, 2024
  12. ryanofsky referenced this in commit 19dea85cf2 on Mar 29, 2024
  13. in CMakeLists.txt:101 in 4e70ad4719
      99 | +install(EXPORT LibmultiprocessTargets
     100 |    NAMESPACE Libmultiprocess::
     101 | -  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake COMPONENT lib)
     102 | +  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Libmultiprocess COMPONENT lib)
     103 | +include(CMakePackageConfigHelpers)
     104 | +configure_package_config_file(
    


    ryanofsky commented at 11:54 PM on March 29, 2024:

    I think there may be need to be some additional changes to this file to make the package "relocatable" according to https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html#creating-relocatable-packages.

    Specifically the PUBLIC include directory $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> on line 84 above and ${CAPNP_INCLUDE_DIRECTORY}` on line 85 look like they will add include paths from the build system to the exported targets, and potentially cause problems in some build configurations. This might not be a problem for the bitcoin depends build, though, because it is building everything on one system.

    Possible fixes to replace the $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> line might be:

    Possible fix to replace the ${CAPNP_INCLUDE_DIRECTORY} line might be to change target_link_libraries(multiprocess PRIVATE CapnProto::capnp) from PRIVATE to PUBLIC, assuming that making capnproto a public dependency will cause cmake to propagate the necessary includes.

  14. ryanofsky approved
  15. ryanofsky commented at 12:18 AM on March 30, 2024: collaborator

    Code review ACK 4e70ad47191f85188da869400690c22f6f81e1e0. This should make it easier to depend on libmultprocess in cmake projects, using a find_package call and not having to include files directly.

    I think I would like to rename a few things in the PR, to make new package names match existing component names (bin and lib). I also don't like the redundant "Libmultiprocess/Libmultiprocess" in some installed filenames, and the way one package name is a prefix of the other, since they are side-by-side dependencies. I can post a followup PR with some renames though.

  16. ryanofsky merged this on Mar 30, 2024
  17. ryanofsky closed this on Mar 30, 2024

  18. ryanofsky referenced this in commit c6a1d7fb6b on Mar 30, 2024
  19. ryanofsky referenced this in commit 3f8483b61a on Mar 30, 2024
  20. hebasto deleted the branch on Mar 30, 2024
  21. ryanofsky referenced this in commit 3e6c61fdc2 on Jun 13, 2024
  22. ryanofsky referenced this in commit eecd63c8e2 on Jul 11, 2024
  23. ryanofsky referenced this in commit e58937ea45 on Jul 12, 2024
  24. ryanofsky referenced this in commit 48a2fc6fb1 on Jul 16, 2024
  25. ryanofsky referenced this in commit 8574f79db9 on Jul 16, 2024
  26. Sjors referenced this in commit c2dbbc5fb7 on Jul 17, 2024
  27. Sjors referenced this in commit fa0a0fa537 on Jul 17, 2024
  28. Sjors referenced this in commit 10100360b6 on Jul 18, 2024
  29. Sjors referenced this in commit 39c615dbdc on Jul 18, 2024
  30. ryanofsky referenced this in commit 33e86e04d1 on Jul 18, 2024
  31. ryanofsky referenced this in commit b3a5eb738f on Jul 18, 2024
  32. Sjors referenced this in commit 3cfcac15ba on Jul 19, 2024
  33. ryanofsky referenced this in commit 261395944e on Jul 24, 2024
  34. ryanofsky referenced this in commit c030548f20 on Jul 26, 2024
  35. ryanofsky referenced this in commit ebe93a5d0a on Sep 26, 2024
  36. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 12:30 UTC

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