From 99a5c595cf1613a7ff6b550b84c9f43c1a1198c8 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 30 Oct 2024 16:50:12 +0100
Subject: [PATCH] [cmake] Different MSVC versions create different cpm ext
 project builds.

Will rebuild all ext packages on msvc.
---
 scripts/cmake/BuildExternalProject.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/cmake/BuildExternalProject.cmake b/scripts/cmake/BuildExternalProject.cmake
index 22f9d772384..4a8172c0fbe 100644
--- a/scripts/cmake/BuildExternalProject.cmake
+++ b/scripts/cmake/BuildExternalProject.cmake
@@ -29,7 +29,11 @@ macro(BuildExternalProject_set_build_dir target argn_string)
             IS_PREFIX PROJECT_BINARY_DIR "${CPM_SOURCE_CACHE}" _is_inside_build
         )
         if(NOT _is_inside_build)
-            string(SHA256 _hash "${CMAKE_GENERATOR};${argn_string}")
+            string(
+                SHA256
+                    _hash
+                    "${CMAKE_GENERATOR};${argn_string}${MSVC_TOOLSET_VERSION}"
+            )
             set(build_dir "${CPM_SOURCE_CACHE}/_ext/${target}/${_hash}")
         endif()
     endif()
-- 
GitLab