From a62647c67b747329f7e64bb43a2d97adeebb40fb Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@gmail.com>
Date: Fri, 27 Apr 2018 10:32:02 +0100
Subject: [PATCH] Set CMAKE_SYSTEM_VERSION for external project configuration

This is especially important on Windows 10 where we are targeting
the 8.1 SDK for Windows 7 and require the version to be consistent
in all project files that are generated.
---
 buildconfig/CMake/Eigen.cmake            | 2 +-
 buildconfig/CMake/GoogleTest.cmake       | 2 +-
 buildconfig/CMake/Python-xmlrunner.cmake | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/buildconfig/CMake/Eigen.cmake b/buildconfig/CMake/Eigen.cmake
index 683267ae67d..160b72e09c6 100644
--- a/buildconfig/CMake/Eigen.cmake
+++ b/buildconfig/CMake/Eigen.cmake
@@ -18,7 +18,7 @@ else()
   # for static libraries, object libraries, and executables without exports.
   cmake_policy(SET CMP0063 "OLD")
 
-  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/extern-eigen )
+  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/extern-eigen )
   execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/extern-eigen )
 
   set(Eigen3_DIR "${CMAKE_BINARY_DIR}/extern-eigen/install/share/eigen3/cmake" CACHE PATH "")
diff --git a/buildconfig/CMake/GoogleTest.cmake b/buildconfig/CMake/GoogleTest.cmake
index 5c218edcefe..1a23f840e2a 100644
--- a/buildconfig/CMake/GoogleTest.cmake
+++ b/buildconfig/CMake/GoogleTest.cmake
@@ -21,7 +21,7 @@ else()
   # Download and unpack googletest at configure time
   configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/GoogleTest.in
                  ${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt @ONLY)
-  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} .
                   RESULT_VARIABLE result
                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
   if(result)
diff --git a/buildconfig/CMake/Python-xmlrunner.cmake b/buildconfig/CMake/Python-xmlrunner.cmake
index 15c09c1a2d8..d5d2e61da95 100644
--- a/buildconfig/CMake/Python-xmlrunner.cmake
+++ b/buildconfig/CMake/Python-xmlrunner.cmake
@@ -14,7 +14,7 @@ else()
   set ( XMLRUNNER_DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/python-xmlrunner-download )
   configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/Python-xmlrunner.in ${XMLRUNNER_DOWNLOAD_DIR}/CMakeLists.txt)
 
-  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${XMLRUNNER_DOWNLOAD_DIR} )
+  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} . WORKING_DIRECTORY ${XMLRUNNER_DOWNLOAD_DIR} )
   execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${XMLRUNNER_DOWNLOAD_DIR} )
 
   set(PYTHON_XMLRUNNER_DIR "${CMAKE_BINARY_DIR}/python-xmlrunner-src" CACHE PATH "Location of xmlrunner package")
-- 
GitLab