From 24a475410c133c6a4def0d481d7ef7b168bbbcc5 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Mon, 15 Jul 2024 10:50:42 -0700 Subject: [PATCH] Add an option to force use of an external copy of mdspan. This is necessary to fix a compiler error detected when updating CMake to 3.30 in vcpkg: https://github.com/microsoft/vcpkg/pull/39896#issuecomment-2227420223 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7821b27..723a1a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,11 @@ include(GNUInstallDirs) include(CMakeDependentOption) include(CMakePackageConfigHelpers) -if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake) +option(USE_EXTERNAL_MDSPAN "Use external copy of mdspan" OFF) + +if(${USE_EXTERNAL_MDSPAN}) + find_package(mdspan CONFIG REQUIRED) +elseif(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake) include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake) conan_basic_setup() find_package(mdspan CONFIG REQUIRED)