marzer / tomlplusplus

Header-only TOML config file parser and serializer for C++17.
https://marzer.github.io/tomlplusplus/
MIT License
1.58k stars 152 forks source link

feat: install examples for top level builds #233

Closed Scrumplex closed 2 months ago

Scrumplex commented 2 months ago

What does this change do?

This change installs built examples as binaries. This might be useful for distribution packagers to provide these example programs in their packages.

Is it related to an existing bug report or feature request?

N/A

Pre-merge checklist

marzer commented 2 months ago

Hmmmn, I think this should also have an option to control it, and be off by default. I know I personally have never wanted the INSTALL target of a project to install examples/demos/tests, et cetera, when I was doing a system build; I imagine many others are the same.

Scrumplex commented 2 months ago

I would argue that setting -Dbuild_examples=true would only make sense in the context of a system build if those examples are also installed. Otherwise, it doesn't really make much sense to build those examples when your intent is to package the software for a system build.

marzer commented 2 months ago

~I don't want example binaries to install by default. This is standard practice.~

would only make sense in the context of a system build if those examples are also installed

~I'm saying people shouldn't be surprised by unexpected example binaries being installed if they try to install the lib system-wide, and it appears your change would cause that.~

Never mind, see below 😅

marzer commented 2 months ago

Oh, wait a minute, I get what you're saying now. People have to opt-in to building the examples to begin with, heh. Sorry, brain-fart. Yeah this makes sense.

Scrumplex commented 2 months ago

Oh, I didn't see your comment before pushing. Lemme reset back ^^

Edit: Note to self: Check PR comments before running gh pr ready --undo ^^

marzer commented 2 months ago

🎉 cheers :)