From 2f3cd7775a527913890ee094bdbb4c82509f70dd Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 23 Aug 2017 18:02:44 +0300 Subject: [PATCH] Added list of Windows XP compatible toolsets to CMake When generating projects for Visual Studio 2017 with v141_xp toolset CMake no longer warns about incompatibility with Windows XP --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4b4023269..6a94aa3c08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,15 @@ include( CreateLaunchers ) include( FindPackageHandleStandardArgs ) # Produce a warning if XP support will be missing. -if( MSVC14 AND NOT CMAKE_GENERATOR_TOOLSET STREQUAL "v140_xp" ) - message( WARNING "This project supports Windows XP (including XP x64), but you must set the optional toolset to v140_xp manually to have it in your build! Use -T \"v140_xp\" from the command prompt." ) +if( MSVC ) + list( APPEND WINXP_TOOLSETS v140_xp v141_xp) + list( FIND WINXP_TOOLSETS "${CMAKE_GENERATOR_TOOLSET}" HAVE_WINXP_SUPPORT) + + if( HAVE_WINXP_SUPPORT EQUAL -1 ) + string( REPLACE ";" " or " WINXP_TOOLSETS_STR "${WINXP_TOOLSETS}" ) + message( WARNING "This project supports Windows XP but you must set the optional toolset to ${WINXP_TOOLSETS_STR} manually to have it in your build!\n" + "Assign toolset's name to CMAKE_GENERATOR_TOOLSET variable or use -T from the command prompt." ) + endif() endif() # Support cross compiling