From da1902ac72aca4a7f48aae847f2b4eb13bc487dc Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 22 Jan 2016 15:27:30 -0800 Subject: [PATCH] use CMake InstallRequiredSystemLibraries for MSVC --- cmake/macros/GenerateInstallers.cmake | 5 ++++ cmake/macros/InstallBesideConsole.cmake | 1 - cmake/macros/ManuallyInstallMSVC.cmake | 37 ------------------------- interface/CMakeLists.txt | 1 - 4 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 cmake/macros/ManuallyInstallMSVC.cmake diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 4d7119d737..e0523f32d3 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -25,6 +25,11 @@ macro(GENERATE_INSTALLERS) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${_DISPLAY_NAME}) if (WIN32) + # include CMake module that will install compiler system libraries + # so that we have msvcr120 and msvcp120 installed with targets + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ${INTERFACE_INSTALL_DIR}) + include(InstallRequiredSystemLibraries) + set(CPACK_NSIS_MUI_ICON "${HF_CMAKE_DIR}/installer/installer.ico") # install and reference the Add/Remove icon diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 5f1dd00821..e257defcb7 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -70,6 +70,5 @@ macro(install_beside_console) set(TARGET_INSTALL_DIR ${COMPONENT_INSTALL_DIR}) set(TARGET_INSTALL_COMPONENT ${SERVER_COMPONENT}) manually_install_ssl_eay() - manually_install_msvc() endmacro() diff --git a/cmake/macros/ManuallyInstallMSVC.cmake b/cmake/macros/ManuallyInstallMSVC.cmake deleted file mode 100644 index ac899427a7..0000000000 --- a/cmake/macros/ManuallyInstallMSVC.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# -# ManuallyInstallMSVC.cmake -# cmake/macros -# -# Copyright 2016 High Fidelity, Inc. -# Created by Stephen Birarda on January 22nd, 2016 -# -# Distributed under the Apache License, Version 2.0. -# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -# - -# On windows fixup_bundle does not find msvcr120.dll and msvcp120.dll that our targets need to be re-distributable. -# We use this macro to find them and manually install them beside the targets - -macro(manually_install_msvc) - if (WIN32) - # look for the msvcr DLLs required by this target - find_path(MSVC_DLL_PATH msvcr120.dll PATHS "C:/Windows/System32" NO_DEFAULT_PATH) - - if (MSVC_DLL_PATH-NOTFOUND) - # we didn't get the path to the DLLs - on production or PR build this is a fail - if (PRODUCTION_BUILD OR PR_BUILD) - message(FATAL_ERROR "Did not find MSVC_DLL_PATH for msvcr120.dll and msvcp120.dll.\ - Both are required to package re-distributable installer." - ) - endif () - else () - # manually install the two DLLs for this component - install( - FILES "${MSVC_DLL_PATH}/msvcr120.dll" "${MSVC_DLL_PATH}/msvcp120.dll" - DESTINATION ${TARGET_INSTALL_DIR} - COMPONENT ${TARGET_INSTALL_COMPONENT} - ) - endif () - - endif () -endmacro() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 3ae01f3673..b4ce53b92a 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -267,7 +267,6 @@ if (WIN32) set(TARGET_INSTALL_DIR ${INTERFACE_INSTALL_DIR}) set(TARGET_INSTALL_COMPONENT ${CLIENT_COMPONENT}) manually_install_ssl_eay() - manually_install_msvc() package_libraries_for_deployment() endif()