summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-03-23 12:11:34 +0000
committerJose Fonseca <jfonseca@vmware.com>2016-03-23 12:12:04 +0000
commit2d32ed513e1e54b56b36d46bf51aae0d200862c6 (patch)
tree6d33c89a187145f76457c5d42bd9da25195edb0d /gui
parent3a372a338fe4ee38c33673d5f6d3f43ceb03b9e7 (diff)
cmake: Set VCINSTALLDIR for windeployqt.
Diffstat (limited to 'gui')
-rw-r--r--gui/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 06fd4919..d5823447 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -151,6 +151,19 @@ if (WIN32 AND NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_VERSION VERSION_LESS 3.1)
file (TO_NATIVE_PATH "${QT_BIN_DIR}" QT_BIN_DIR_NATIVE)
# It's safer to use `\` separateors in the Path, but we need to escape them
string (REPLACE "\\" "\\\\" QT_BIN_DIR_NATIVE "${QT_BIN_DIR_NATIVE}")
+
+ # windeployqt needs VCINSTALLDIR to copy MSVC Runtime files, but it's
+ # usually not define with MSBuild builds.
+ if ($ENV{VCINSTALLDIR})
+ set (VCINSTALLDIR "$ENV{VCINSTALLDIR}")
+ elseif (MSVC12)
+ set (VCINSTALLDIR "\$ENV{VS120COMNTOOLS}/../../VC")
+ elseif (MSVC14)
+ set (VCINSTALLDIR "\$ENV{VS140COMNTOOLS}/../../VC")
+ else ()
+ message (FATAL_ERROR "Unsupported MSVC version ${MSVC_VERSION}")
+ endif ()
+
install (CODE "
message (STATUS \"Running Qt Deploy Tool...\")
if (CMAKE_INSTALL_CONFIG_NAME STREQUAL \"Debug\")
@@ -163,6 +176,7 @@ if (WIN32 AND NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_VERSION VERSION_LESS 3.1)
execute_process (COMMAND
\"${CMAKE_COMMAND}\" -E env
\"Path=${QT_BIN_DIR_NATIVE};\$ENV{SystemRoot}\\\\System32;\$ENV{SystemRoot}\"
+ \"VCINSTALLDIR=${VCINSTALLDIR}\"
\"${QT_WINDEPLOYQT_EXECUTABLE}\"
\${QT_WINDEPLOYQT_FLAGS}
\"\${CMAKE_INSTALL_PREFIX}/bin/qapitrace.exe\"