bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.66k stars 466 forks source link

Add cmake option `BACKWARD_INSTALL` to allow backward-cpp built as a subproject but not be installed #338

Open zhao-shihan opened 2 weeks ago

lahwaacz commented 2 weeks ago

This should not be done with yet another option, but by changing the way you use the subproject:

add_subdirectory (path-to-backward-cpp EXCLUDE_FROM_ALL)

See https://stackoverflow.com/a/64900982

zhao-shihan commented 2 weeks ago

This should not be done with yet another option, but by changing the way you use the subproject:

add_subdirectory (path-to-backward-cpp EXCLUDE_FROM_ALL)

See https://stackoverflow.com/a/64900982

I certainly agree! However, in many cases FetchContent is much convenient than raw add_subdirectory. But unlike add_subdirectory, FetchContent have no EXCLUDE_FROM_ALL until CMake 3.28, which is a pretty new release (Debian 12 has just 3.25). Therefore, add this option might help old toolchains.

Libraries like fmt and yaml-cpp also provide corresponding XYZ_INSTALL. It does not harm in practice.