{
 "number": 35515,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35515",
 "title": "cmake: Use target file name for manpage installation",
 "author": "hebasto",
 "author_association": "MEMBER",
 "created_at": "2026-06-11T15:53:03Z",
 "updated_at": "2026-07-28T18:37:54Z",
 "age_days": 98,
 "draft": false,
 "labels": [
  "Build system"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
 "head_ref": "260611-cmake-install",
 "head_repo": "hebasto/bitcoin",
 "head_history": [],
 "additions": 1,
 "deletions": 1,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "ryanofsky",
      "url": "https://github.com/bitcoin/bitcoin/pull/35515#pullrequestreview-4501243610"
     },
     {
      "login": "BrandonOdiwuor",
      "url": "https://github.com/bitcoin/bitcoin/pull/35515#pullrequestreview-4579528051"
     }
    ],
    "concept_ack": [
     {
      "login": "151henry151",
      "url": "https://github.com/bitcoin/bitcoin/pull/35515#issuecomment-5108268588"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "ryanofsky": {
   "kind": "ack",
   "hash": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "t": "2026-06-15T21:20:31Z",
   "stale": false
  },
  "BrandonOdiwuor": {
   "kind": "ack",
   "hash": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "t": "2026-06-26T12:46:14Z",
   "stale": false
  },
  "151henry151": {
   "kind": "ack",
   "hash": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "t": "2026-07-28T18:37:51Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 3,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 1,
  "changes_requested": 0,
  "distinct_reviewers": [
   "151henry151",
   "BrandonOdiwuor",
   "fanquake",
   "ryanofsky"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-06-17T14:17:52Z",
  "last_reviewer_activity": "2026-07-28T18:37:51Z",
  "last_reviewer": "151henry151",
  "author_silent_days": 92,
  "waiting_on_author_days": 50,
  "days_since_update": 50
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "The manpage file name is expected to coincide with the name of the installed executable file. The latter defaults to the logical target name, but diverges from it if any of the following target properties is set:\n - [`OUTPUT_NAME`](https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME.html)\n - [`OUTPUT_NAME_<CONFIG>`](https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME_CONFIG.html)\n - [`RUNTIME_OUTPUT_NAME`](https://cmake.org/cmake/help/latest/prop_tgt/RUNTIME_OUTPUT_NAME.html)\n - [`RUNTIME_OUTPUT_NAME_<CONFIG>`](https://cmake.org/cmake/help/latest/prop_tgt/RUNTIME_OUTPUT_NAME_CONFIG.html)\n\nUse the [`$<TARGET_FILE_BASE_NAME>`](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:TARGET_FILE_BASE_NAME) generator expression, which resolves all of the properties above, instead of the logical target name.\n\nNo change in behavior for any current target, as none of them sets any of these properties.\n\n---\n\nFound this useful when replacing the `bitcoin-qt` target with the new `bitcoin-qml` one in the QML GUI staging branch.",
 "commits": [
  {
   "sha": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "date": "2026-06-11T15:47:20Z",
   "message": "cmake: Use target file name for manpage installation\n\nThe manpage file name is expected to coincide with the name of the\ninstalled executable file. The latter defaults to the logical target\nname, but diverges from it if any of the following target properties\nis set:\n - `OUTPUT_NAME`\n - `OUTPUT_NAME_<CONFIG>`\n - `RUNTIME_OUTPUT_NAME`\n - `RUNTIME_OUTPUT_NAME_<CONFIG>`\n\nUse the `$<TARGET_FILE_BASE_NAME>` generator expression, which resolves\nall of the properties above, instead of the logical target name.\n\nNo change in behavior for any current target, as none of them sets any\nof these properties."
  }
 ],
 "timeline": [
  {
   "t": "2026-06-12T09:08:32Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nSomewhat tangential to the change here, but are we renaming `bitcoin-qt` to `bitcoin-qml`? Couldn't the GUI just stay named `bitcoin-qt`, given that the new QML code is just a drop-in replacement, and we aren't going to ship/have two different qt binaries at any point?"
  },
  {
   "t": "2026-06-12T09:29:36Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nThe current QML GUI staging branch retains `src/qt/CMakeLists.txt` until its final removal (which hasn't done yet). The new `src/qml/CMakeLists.txt` introduces new targets that require unique logical names: the `bitcoin_qml` library and the `bitcoin-qml` executable.\n\nHere is the relevant code snippet:\n```cmake\n# Use the `bitcoin-qml` target as a drop-in replacement\n# for the legacy QtWidgets-based `bitcoin-qt`.\nset_target_properties(bitcoin-qt PROPERTIES\n  OUTPUT_NAME \"bitcoin-qt-legacy\"\n  EXCLUDE_FROM_ALL TRUE\n)\nset_target_properties(bitcoin-qml PROPERTIES\n  OUTPUT_NAME \"bitcoin-qt\"\n)\n```\n\n[quoted text omitted]\nNo, we are not."
  },
  {
   "t": "2026-06-15T21:20:31Z",
   "kind": "review",
   "who": "ryanofsky",
   "assoc": "CONTRIBUTOR",
   "state": "APPROVED",
   "commit": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "text": "Code review ACK 410862154e58c3bfd7ec78f15d208f0742cb1f1e but concept -0.\n\nThis change adds complexity and invites less consistent naming, and the PR description claims it is useful without explaining why it is useful. I don't know why we'd want to have cmake target names that don't match output names and filenames in doc/man/.  It could help to have an explanation of what problem that solves and what other alternatives were considered. Not very important though, and the change does seem safe, just not clearly motivated."
  },
  {
   "t": "2026-06-17T07:53:14Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nPlease see https://github.com/bitcoin/bitcoin/pull/35515#issuecomment-4689630214.\n\n[quoted text omitted]\nFor example, this might help to avoid confusion between the `bitcoin-cli` and `bitcoin_cli` targets."
  },
  {
   "t": "2026-06-17T11:35:03Z",
   "kind": "comment",
   "who": "ryanofsky",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nThanks I skimmed that comment and didn't realize it actually showed the code using this.\n\nMy opinion is that using having the `bitcoin-qt` target create a `bitcoin-qt-legacy` binary and having the `bitcoin-qml` target create a `bitcoin-qt` binary is pretty confusing and that it would be clearer to have the target names match the binary names, even if it results in a few extra lines of code changing in CMakeLists.txt. I think the approach described there is ok, but it seems unnecessarily confusing unless there are other benefits to using OUTPUT_NAME I'm not aware of.\n\n(IMO, it would also be better to not rename binaries at all but that is a separate question about packaging, not cmake implementation. I would just call the new binary `bitcoin-qml` and create desktop icons for it and also have the `bitcoin gui` command call it. Bitcoin core has good support for previous releases and should allow running `bitcoin-qt` from an old release and `bitcoin-qml` from the new release to ease difficulties like minor bugs and missing features that seem likely to arise from the transition.)\n\n[quoted text omitted]\nI'm not sure I see a way OUTPUT_NAME would help here. I guess we could rename the library targets like `bitcoin_cli` to `libbitcoin_cli` and `bitcoin_node` to `libbitcoin_node` and use OUTPUT_NAME to keep the same library filenames. But if we did, that our libraries don't have manpages anyway and I don't think the manpage logic implemented here would be helpful, so this PR wouldn't seem relevant."
  },
  {
   "t": "2026-06-17T14:17:52Z",
   "kind": "comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nThe code above is used in the current QML GUI staging branch, which is still a WIP.\n\nThe current rough consensus is to make the new QML GUI a drop-in replacement for the legacy one. Keeping the executable names unmodified minimizes the changes in the release scripts and the documentation.\n\n[quoted text omitted]\nI've been thinking in opposite direction:\n```diff\n--- a/src/CMakeLists.txt\n+++ b/src/CMakeLists.txt\n@@ -355,7 +355,7 @@ target_link_libraries(bitcoin_cli\n\n # Bitcoin Core RPC client\n if(BUILD_CLI)\n-  add_executable(bitcoin-cli bitcoin-cli.cpp init/basic.cpp)\n+  add_executable(bitcoin_cli_exe bitcoin-cli.cpp init/basic.cpp)\n   add_windows_resources(bitcoin-cli bitcoin-cli-res.rc)\n   add_windows_application_manifest(bitcoin-cli)\n   target_link_libraries(bitcoin-cli\n```\n\nI find `bitcoin_cli_exe` to be a much more convenient target name than `bitcoin-cli` when working in an IDE."
  },
  {
   "t": "2026-06-17T14:43:26Z",
   "kind": "comment",
   "who": "ryanofsky",
   "assoc": "CONTRIBUTOR",
   "text": "Thanks for explanations! Your logic makes sense even if I disagree, and if you think this approach is better, I've acked the code change and don't want to get in the way.\n\n- re: \"Keeping the executable names unmodified minimizes the changes in the release scripts and the documentation.\" I think this should be a non-goal. It seems to me that existing documentation about bitcoin-qt might no longer apply to the new GUI updating the name is a good way to make sure it is up to date.\n\n- As a command line user, not a gui user, I would find it annoying to have to build `test_bitcoin_exe`, for example instead of `test_bitcoin`. I actually think current target names are perfectly fine, but if I wanted to more clearly distinguish libraries from executables, I would change the library names not the executable names. Similarly, I also prefer unix convention of prefixing library names with `lib` over windows convention of suffixing executables with `exe`"
  },
  {
   "t": "2026-06-26T12:46:14Z",
   "kind": "review",
   "who": "BrandonOdiwuor",
   "assoc": "CONTRIBUTOR",
   "state": "COMMENTED",
   "commit": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
   "text": "ACK 410862154e58c3bfd7ec78f15d208f0742cb1f1e\n\nTested before/after on master vs 410862154e58c3bfd7ec78f15d208f0742cb1f1e: (Tested on `Ubuntu 24.04.4 LTS` with `cmake version 3.28.3`)\n\n- Applied temporary RUNTIME_OUTPUT_NAME=\"bitcoind-runtime\" on the `bitcoind` target.\n\n- Confirmed that the old logic installs `bitcoind.1` (mismatch with binary name).\n\n- New logic correctly uses `$<TARGET_FILE_BASE_NAME:...>` and installs the manpage matching the actual binary name.\n\nThe change is correct and future-proofs manpage installation for targets using OUTPUT_NAME* / RUNTIME_OUTPUT_NAME* properties."
  },
  {
   "t": "2026-07-28T18:37:51Z",
   "kind": "comment",
   "who": "151henry151",
   "assoc": "CONTRIBUTOR",
   "text": "Tested ACK 410862154e58c3bfd7ec78f15d208f0742cb1f1e\n\nTested on Debian 13 with cmake 3.31.6 / Ninja 1.12.1 (`-DINSTALL_MAN=ON`), and also checked the genex under cmake 3.22.0 (current `cmake_minimum_required`). Same-tree master vs this patch: install trees were identical (`diff -r`). Exercised OUTPUT_NAME (including a bitcoin-qt stand-in for the QML case), OUTPUT_NAME_<CONFIG> under Ninja Multi-Config, and the missing-manpage case \u2014 configure is fine, install fails with a clear \"cannot find \u2026/*.1\". gen-manpages.py derives the page name from the binary's basename, so it stays consistent with this lookup; its hardcoded binary list means a target rename still needs a manual update there. Concept ACK as cheap future-proofing \u2014 `$<TARGET_FILE_BASE_NAME>` is the right tool here anyway (including that it drops the `.exe` suffix on Windows rather than making us hand-roll that).\n\nOne thing the description misses: the genex also picks up `<CONFIG>_POSTFIX` / `DEBUG_POSTFIX`. Setting `DEBUG_POSTFIX \"d\"` on the `bitcoind` target with a Debug build makes install look for `bitcoindd.1` and install `bitcoindd`. Fine if that's the binary you shipped, but `doc/man/` won't have a postfixed page, so you get an install-time failure only in that config \u2014 easy to miss on normal Linux CI. Nothing in tree sets this today, so not blocking. Could the PR description list the postfix properties next to the four OUTPUT_NAME* ones?\n\nSmall nit: a comment by the genex noting the manpage has to follow the installed filename (not the logical target name) would help.\n\nSeparately, +1 to ryanofsky on naming \u2014 I'd rather see the new binary called bitcoin-qml. It's the more descriptive name once the GUI is no longer QtWidgets-based, and it keeps target, binary, manpage, and docs all lined up. But that's a QML-branch question, not a reason to hold this up."
  }
 ],
 "labels_log": [
  {
   "t": "2026-06-11T15:53:03Z",
   "action": "labeled",
   "label": "Build system",
   "who": "hebasto"
  }
 ],
 "state_log": [],
 "text_chars": 9283,
 "text_tokens_estimate": 2320,
 "changed_paths": [
  "cmake/module/InstallBinaryComponent.cmake"
 ],
 "files": [
  {
   "path": "cmake/module/InstallBinaryComponent.cmake",
   "add": 1,
   "del": 1
  }
 ],
 "test_lines": 0,
 "git": {
  "head": "410862154e58c3bfd7ec78f15d208f0742cb1f1e",
  "head_matches_backup": true,
  "base": "c117bbc467f80b4f28bb8c4d97a4181cd714bfc9",
  "commits": [
   {
    "sha": "410862154e",
    "subject": "cmake: Use target file name for manpage installation",
    "files": 1,
    "add": 1,
    "del": 1
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "17f7f002e0483bf9",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}