Skip to content

Improve CMake setup - #118

Merged
arun11299 merged 5 commits into
arun11299:masterfrom
lunacd:cmake4
May 4, 2025
Merged

Improve CMake setup#118
arun11299 merged 5 commits into
arun11299:masterfrom
lunacd:cmake4

Conversation

@lunacd

@lunacdlunacd commented May 4, 2025

Copy link
Copy Markdown
Contributor

Fixes#115

This PR makes changes to the CMake setup of this project, that should bring the following benefits:

  1. It's easy now to package this project, should anyone be interested. The CML of this project now configures and installs all the CMake config and metadata that find_package expects. Consuming a packaged and installed version of this library is as easy as:
find_package(cpp-subprocessREQUIRED)
target_link_libraries(<target>PRIVATEcpp-subprocess::subprocess)
  1. Even without packaging, this new setup is easier to consume for CMake. The cmake needed to consume this library is updated in README. The benefit of doing that over vendoring a copy of cpp-subprocess directly into somebody's project, is to easily consume upstream updates without having do the copying all over again and potentially ending up with a confusing git log with first-party and upstream changes mangled together.
  2. CMake now reflects the version of this library.
  3. The include path of this project is now consistently #include <cpp-subprocess/subprocess.hpp>, as documented in README. It can be slightly confusing if sometimes this project is called subprocess.hpp and sometimes it's cpp-subprocess/subprocess.hpp, at least within the official repo itself.

CMake 4 has removed compatibility with CMake < 3.5
Bumping minimum required version to 3.5 enables
CMake 4 to build this code.
This commit configures and installs CMake metadata files. This also
provides the namespaced ALIAS target `cpp-subprocess::subprocess`.
@arun11299

Copy link
Copy Markdown
Owner

@lunacd Awesome! Thanks for your contribution.

@arun11299
arun11299 merged commit f6232a7 into arun11299:masterMay 4, 2025
@lunacd
lunacd deleted the cmake4 branch May 4, 2025 15:12
@fanquakefanquake mentioned this pull request May 19, 2025
fanquake added a commit to bitcoin/bitcoin that referenced this pull request May 21, 2025
e63a703 subprocess: Don't add an extra whitespace at end of Windows command line (laanwj)
Pull request description:
A list of the backported PRs:
- arun11299/cpp-subprocess#119
The following PRs were skipped for backporting:
- arun11299/cpp-subprocess#118 because there is no changes in the header code.
Required for #32566.
ACKs for top commit:
laanwj:
Code review ACK e63a703
Tree-SHA512: 69a74aa7f9c611a9ec910e27161c5e9e147067d37f8335953cd3875fcc88dc840a2f7b206bb603f22507159e406b1449f1dc4702fffe890bb824672641b4feed
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Jun 28, 2026
2f816f4 subprocess: Don't add an extra whitespace at end of Windows command line (laanwj)
Pull request description:
A list of the backported PRs:
- arun11299/cpp-subprocess#119
The following PRs were skipped for backporting:
- arun11299/cpp-subprocess#118 because there is no changes in the header code.
Required for bitcoin/bitcoin#32566.
ACKs for top commit:
laanwj:
Code review ACK 2f816f4
Tree-SHA512: 69a74aa7f9c611a9ec910e27161c5e9e147067d37f8335953cd3875fcc88dc840a2f7b206bb603f22507159e406b1449f1dc4702fffe890bb824672641b4feed
BigcoinBGC pushed a commit to BigcoinBGC/bigcoin that referenced this pull request Jun 30, 2026
34da215 subprocess: Don't add an extra whitespace at end of Windows command line (laanwj)
Pull request description:
A list of the backported PRs:
- arun11299/cpp-subprocess#119
The following PRs were skipped for backporting:
- arun11299/cpp-subprocess#118 because there is no changes in the header code.
Required for bitcoin/bitcoin#32566.
ACKs for top commit:
laanwj:
Code review ACK 34da215
Tree-SHA512: 69a74aa7f9c611a9ec910e27161c5e9e147067d37f8335953cd3875fcc88dc840a2f7b206bb603f22507159e406b1449f1dc4702fffe890bb824672641b4feed
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Aug 19, 2026
e63a7034f0386789628dcb940d99ec6436d21128 subprocess: Don't add an extra whitespace at end of Windows command line (laanwj)
Pull request description:
A list of the backported PRs:
- arun11299/cpp-subprocess#119
The following PRs were skipped for backporting:
- arun11299/cpp-subprocess#118 because there is no changes in the header code.
Required for bitcoin/bitcoin#32566.
ACKs for top commit:
laanwj:
Code review ACK e63a7034f0386789628dcb940d99ec6436d21128
Tree-SHA512: 69a74aa7f9c611a9ec910e27161c5e9e147067d37f8335953cd3875fcc88dc840a2f7b206bb603f22507159e406b1449f1dc4702fffe890bb824672641b4feed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMake interface target

2 participants

@lunacd@arun11299