This follow #670, and fix the case where this project is used with FetchContent, because FetchContent would detect the new CMakeLists.txt and execute it.
Then, if this CMakeLists.txt includes base.cmake, multiple global targets are created in the FetchContent and an error is raised later, in the downstream project() initialization, as its own include of base.cmake would try to define again the same global targets.
Of course, the proper fix would be to gracefully allow multiple inclusions of base.cmake, but that's a lot of work.
Instead, this PR only get what's need to generate CMake export in CMakeLists.txt.
Hi,
This follow #670, and fix the case where this project is used with
FetchContent
, becauseFetchContent
would detect the newCMakeLists.txt
and execute it.Then, if this
CMakeLists.txt
includesbase.cmake
, multiple global targets are created in theFetchContent
and an error is raised later, in the downstreamproject()
initialization, as its own include ofbase.cmake
would try to define again the same global targets.Of course, the proper fix would be to gracefully allow multiple inclusions of
base.cmake
, but that's a lot of work.Instead, this PR only get what's need to generate CMake export in CMakeLists.txt.