Only use embedded GSL if there is no target "GSL"

When using stduuid with FetchContent/CPM.cmake, and also including GSL with such process, it create a conflict and it then become ambiguous which file is used where.
Concrete use case:
```cmake
CPMAddPackage(
  NAME GSL
  GIT_REPOSITORY "https://github.com/microsoft/GSL"
  GIT_TAG "v4.0.0"
)
CPMAddPackage(
  NAME stduuid
  GIT_REPOSITORY "https://github.com/mariusbancila/stduuid"
  GIT_TAG "master"
)
```
This commit is contained in:
Olivier Le Doeuff 2022-08-04 18:25:21 +02:00 committed by GitHub
parent 3afe7193fa
commit 29a7b13718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ if (UUID_TIME_GENERATOR)
endif()
# Using span from std
if (NOT UUID_USING_CXX20_SPAN)
if (NOT UUID_USING_CXX20_SPAN AND NOT TARGET GSL)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)