Sync with alchemyng for VCRedist update

This commit is contained in:
Lirusaito
2019-04-19 23:25:47 -04:00
parent 8ef3e923e8
commit d194dfbc09
6 changed files with 120 additions and 124 deletions

View File

@@ -18,16 +18,15 @@ set(cmake_SOURCE_FILES
CARes.cmake
CEFPlugin.cmake
CMakeCopyIfDifferent.cmake
CURL.cmake
Colladadom.cmake
ConfigurePkgConfig.cmake
CURL.cmake
Copy3rdPartyLibs.cmake
Cwdebug.cmake
DBusGlib.cmake
DeploySharedLibs.cmake
EXPAT.cmake
ExamplePlugin.cmake
FMODSTUDIO.cmake
FindAPR.cmake
FindAutobuild.cmake
FindCARes.cmake
@@ -39,8 +38,10 @@ set(cmake_SOURCE_FILES
FindNDOF.cmake
FindOpenJPEG.cmake
FindTut.cmake
FindVCRedist.cmake
FindURIPARSER.cmake
FindXmlRpcEpi.cmake
FMODSTUDIO.cmake
FreeType.cmake
GLOD.cmake
GStreamer010Plugin.cmake

View File

@@ -0,0 +1,34 @@
include(Variables)
if(WINDOWS)
if(MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1920)
set(VISUAL_STUDIO_VERSION 15.0)
set(VISUAL_STUDIO_VERSION_UPPER 16.0)
elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940)
set(VISUAL_STUDIO_VERSION 16.0)
set(VISUAL_STUDIO_VERSION_UPPER 17.0)
endif ()
set(vswhere "$ENV{PROGRAMFILES\(X86\)}\\Microsoft Visual Studio\\Installer\\vswhere.exe")
if(EXISTS ${vswhere})
execute_process(COMMAND ${vswhere} -version "[${VISUAL_STUDIO_VERSION},${VISUAL_STUDIO_VERSION_UPPER})" -property "installationPath"
OUTPUT_VARIABLE installationPath
OUTPUT_STRIP_TRAILING_WHITESPACE)
file(TO_CMAKE_PATH ${installationPath} installationPath)
set(redistPath "${installationPath}/VC/Redist/MSVC")
file(GLOB redistPath "${installationPath}/VC/Redist/MSVC/*")
list(LENGTH redistPath length)
if(length EQUAL 1)
if(ADDRESS_SIZE EQUAL 64)
set(VISUAL_STUDIO_REDISTRIBUTABLE_NAME "vc_redist.x64.exe" CACHE FILEPATH "Name of Microsoft Visual Studio Redistributable")
set(redistPath "${redistPath}/${VISUAL_STUDIO_REDISTRIBUTABLE_NAME}")
else()
set(VISUAL_STUDIO_REDISTRIBUTABLE_NAME "vc_redist.x86.exe" CACHE FILEPATH "Name of Microsoft Visual Studio Redistributable")
set(redistPath "${redistPath}/${VISUAL_STUDIO_REDISTRIBUTABLE_NAME}")
endif()
if(EXISTS ${redistPath})
set(VISUAL_STUDIO_REDISTRIBUTABLE_PATH ${redistPath} CACHE FILEPATH "Path to the appropriate Microsoft Visual Studio Redistributable")
endif()
endif()
endif()
endif(WINDOWS)