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()