FechContent's EXCLUDE_FROM_ALL keyword in CMake 3.30+ has the impact of ignoring install commands in the dependency project. However, this behavior does not manifest in earlier CMake versions which results in exemplar's gtest dependency being installed when CMake's install target is executed.
CMake 3.30 came out recently (July 2024), so forcing users to upgrade to use beman.exemplar is a bit much to ask.
My suggested fix is to set INSTALL_GTEST to FALSE using a block that contains the FetchContent call.
FechContent'sEXCLUDE_FROM_ALLkeyword in CMake 3.30+ has the impact of ignoringinstallcommands in the dependency project. However, this behavior does not manifest in earlier CMake versions which results in exemplar's gtest dependency being installed when CMake's install target is executed.CMake 3.30 came out recently (July 2024), so forcing users to upgrade to use beman.exemplar is a bit much to ask.
My suggested fix is to set
INSTALL_GTESTtoFALSEusing ablockthat contains theFetchContentcall.