From a81cea2366b9e814861a6f47e5bd460e06f19295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Ga=C3=9Fmann?= Date: Sun, 15 Jan 2017 14:12:57 +0100 Subject: [PATCH] FindSodium.cmake MAKE VS FOLDER SELECTION GENERIC (#471) --- contrib/Findsodium.cmake | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/contrib/Findsodium.cmake b/contrib/Findsodium.cmake index 2bfe8c18..735584d5 100644 --- a/contrib/Findsodium.cmake +++ b/contrib/Findsodium.cmake @@ -104,18 +104,14 @@ elseif (WIN32) message(FATAL_ERROR "the ${_TARGET_ARCH} architecture is not supported by Findsodium.cmake.") endif() string(APPEND _PLATFORM_PATH "/$$CONFIG$$") - # this will need to be maintained manually -.-' - if (MSVC_VERSION EQUAL 1600) - string(APPEND _PLATFORM_PATH "/v100") - elseif (MSVC_VERSION EQUAL 1700) - string(APPEND _PLATFORM_PATH "/v110") - elseif (MSVC_VERSION EQUAL 1800) - string(APPEND _PLATFORM_PATH "/v120") - elseif (MSVC_VERSION EQUAL 1900) - string(APPEND _PLATFORM_PATH "/v140") + + if (MSVC_VERSION LESS 1900) + math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60") else() - message(FATAL_ERROR "msvc version ${MSVC_VERSION} is not supported by Findsodium.cmake.") + math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50") endif() + string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}") + if (sodium_USE_STATIC_LIBS) string(APPEND _PLATFORM_PATH "/static") else()