From 9c0c6b246ceeba4d11a024b05ad6c2e8f7d2ca69 Mon Sep 17 00:00:00 2001 From: Hannes Steffenhagen Date: Sat, 8 Feb 2020 12:58:25 +0000 Subject: [PATCH] Add Microsoft.GSL::GSL alias for GSL This ensures that dependents can be agnostic about whether GSL was added via `add_subdirectory` or `find_package` --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c1370..e0d704e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,10 @@ install( install(EXPORT Microsoft.GSLConfig NAMESPACE Microsoft.GSL:: DESTINATION share/Microsoft.GSL/cmake) export(TARGETS GSL NAMESPACE Microsoft.GSL:: FILE Microsoft.GSLConfig.cmake) +# Add Microsoft.GSL::GSL alias for GSL so that dependents can be agnostic about +# whether GSL was added via `add_subdirectory` or `find_package` +add_library(Microsoft.GSL::GSL ALIAS GSL) + option(GSL_TEST "Generate tests." ${GSL_STANDALONE_PROJECT}) if (GSL_TEST) enable_testing()