Fix T53951: Copy ms runtime dlls using InstallRequiredSystemLibraries.cmake
authorRay Molenkamp <github@lazydodo.com>
Thu, 1 Feb 2018 15:26:14 +0000 (08:26 -0700)
committerRay Molenkamp <github@lazydodo.com>
Thu, 1 Feb 2018 15:26:14 +0000 (08:26 -0700)
Differential Revision: https://developer.blender.org/D3032

build_files/cmake/platform/platform_win32.cmake
source/creator/CMakeLists.txt

index 4b444e6..a2fae22 100644 (file)
@@ -107,7 +107,10 @@ add_definitions(-D_ALLOW_KEYWORD_MACROS)
 add_definitions(-D_WIN32_WINNT=0x600)
 
 # Make cmake find the msvc redistributables
-set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
+set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP FALSE)
+set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
+set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
+set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
 include(InstallRequiredSystemLibraries)
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
index 2bda651..bcb0a7a 100644 (file)
@@ -1024,70 +1024,4 @@ if(WIN32 AND NOT WITH_PYTHON_MODULE)
                COMPONENT Blender
                DESTINATION "."
        )
-       if(CMAKE_CL_64)
-               set(_WIN_PLATFORM x64)
-       else()
-               set(_WIN_PLATFORM x86)
-       endif()
-       if(MSVC12_REDIST_DIR)
-               install(
-                       FILES
-                               ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcp120.dll
-                               ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcr120.dll
-                       DESTINATION "."
-               )
-               if(WITH_OPENMP)
-                       install(
-                               FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.OpenMP/vcomp120.dll
-                               DESTINATION "."
-                       )
-               endif()
-       endif()
-       
-       if(MSVC14_REDIST_DIR)
-               set(KITSDIRx86 "$ENV{${ProgramFilesX86_NAME}}/Windows Kits/10/")
-               set(KITSDIR "$ENV{ProgramFiles}/Windows Kits/10/")
-               if(IS_DIRECTORY ${KITSDIR})
-                       set(KITSPATH "${KITSDIR}/Redist/ucrt/DLLs/${_WIN_PLATFORM}")
-               else()
-                       if(IS_DIRECTORY ${KITSDIRx86})
-                               set(KITSPATH "${KITSDIRx86}/Redist/ucrt/DLLs/${_WIN_PLATFORM}")
-                       else()
-                               message(FATAL_ERROR "Windows 10 SDK directory not found")
-                       endif()
-               endif()
-               FILE(TO_CMAKE_PATH  ${KITSPATH} KITSPATH)
-               install(
-                       FILES
-                               ${KITSPATH}/api-ms-win-core-file-l1-2-0.dll
-                               ${KITSPATH}/api-ms-win-core-file-l2-1-0.dll
-                               ${KITSPATH}/api-ms-win-core-localization-l1-2-0.dll
-                               ${KITSPATH}/api-ms-win-core-processthreads-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-core-processthreads-l1-1-1.dll
-                               ${KITSPATH}/api-ms-win-core-synch-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-core-synch-l1-2-0.dll
-                               ${KITSPATH}/api-ms-win-core-timezone-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-conio-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-convert-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-environment-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-filesystem-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-heap-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-locale-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-math-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-process-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-runtime-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-stdio-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-string-l1-1-0.dll
-                               ${KITSPATH}/api-ms-win-crt-time-l1-1-0.dll
-                               ${KITSPATH}/ucrtbase.dll
-                               ${MSVC14_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC140.CRT/vcruntime140.dll
-                       DESTINATION "."
-               )
-               if(WITH_OPENMP)
-                       install(
-                               FILES ${MSVC14_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC140.OpenMP/vcomp140.dll
-                               DESTINATION "."
-                       )
-               endif()
-       endif()
 endif()