CMake: installer building improvements for Windows

- Implement support for BundleUtilities when Vcpkg is used
- Add some hacky code to copy Qt plugins install directory
- Use same icon for launcher as used for VCMI, launcher one is ugly
This commit is contained in:
Arseniy Shestakov
2017-08-16 18:34:46 +03:00
parent adbfa09e31
commit 03c7bf5ee6
3 changed files with 42 additions and 5 deletions
+30 -1
View File
@@ -7,7 +7,8 @@ if(APPLE)
message(FATAL_ERROR "Could not find macdeployqt")
endif()
install(CODE "
execute_process(COMMAND ${TOOL_MACDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}\" -verbose=2)")
execute_process(COMMAND ${TOOL_MACDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}\" -verbose=2)
")
endif()
install(CODE "
@@ -16,3 +17,31 @@ if(APPLE)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}\" \"\" \"\")
" COMPONENT Runtime)
endif(APPLE)
# This will likely only work for Vcpkg
if(WIN32)
if(ENABLE_LAUNCHER)
# Temporary ugly fix for Qt deployment since windeployqt broken in Vcpkg
install(CODE "
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/\${BUILD_TYPE}/bearer \${CMAKE_INSTALL_PREFIX}/bearer
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/\${BUILD_TYPE}/iconengines \${CMAKE_INSTALL_PREFIX}/iconengines
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/\${BUILD_TYPE}/imageformats \${CMAKE_INSTALL_PREFIX}/imageformats
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/\${BUILD_TYPE}/platforminputcontexts \${CMAKE_INSTALL_PREFIX}/platforminputcontexts
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/\${BUILD_TYPE}/platforms \${CMAKE_INSTALL_PREFIX}/platforms
)
")
endif()
install(CODE "
if(\"\${BUILD_TYPE}\" STREQUAL \"Debug\")
set(dirs \"${CMAKE_PREFIX_PATH}/debug/bin/\")
else()
set(dirs \"${CMAKE_PREFIX_PATH}/bin/\")
endif()
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/VCMI_Client.exe\" \"\" \"\${dirs}\")
" COMPONENT Runtime)
endif(WIN32)