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:
parent
3afe7193fa
commit
29a7b13718
@ -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>)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user