diff --git a/CMakeLists.txt b/CMakeLists.txt index 743907e4c..e1d7dfcd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,10 @@ project(VCMI) # MXE: # - Try to implement MXE support into BundleUtilities so we can deploy deps automatically # +# Vckpg: +# - Improve install code once there is better way to deploy DLLs and Qt plugins +# - Move Vcpkg install BundleUtilities code from osx/CMakeLists.txt +# # Other: # - Cleanup remove_directory copy_directory if performance will be a problem. # We can use some macro over copy_if_different since it's only work for single file. @@ -362,6 +366,7 @@ endif() set(CPACK_PACKAGE_VENDOR "VCMI team") if(WIN32) + # Note: due to NSI script generation process all of the backward slashes here are useful set(CPACK_MONOLITHIC_INSTALL 1) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license.txt") set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") @@ -382,10 +387,10 @@ if(WIN32) # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. - set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/client\\vcmi.ico") - set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/client\\vcmi.ico") + set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/client\\\\vcmi.ico") + set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/client\\\\vcmi.ico") # set the package header icon for MUI - set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/client\\vcmi.ico") + set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/client\\\\vcmi.ico") set(CPACK_NSIS_MENU_LINKS "http://vcmi.eu/" "VCMI Web Site") @@ -396,7 +401,10 @@ if(WIN32) set(CPACK_NSIS_URL_INFO_ABOUT "http://vcmi.eu/") set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") - + # Use BundleUtilities to fix build when Vcpkg is used and disable it for MXE + if(NOT (${CMAKE_CROSSCOMPILING})) + add_subdirectory(osx) + endif() elseif(APPLE AND NOT ENABLE_MONOLITHIC_INSTALL) set(CPACK_MONOLITHIC_INSTALL 1) set(CPACK_GENERATOR "DragNDrop") diff --git a/launcher/VCMI_launcher.ico b/launcher/VCMI_launcher.ico index 449296f49..40818c464 100644 Binary files a/launcher/VCMI_launcher.ico and b/launcher/VCMI_launcher.ico differ diff --git a/osx/CMakeLists.txt b/osx/CMakeLists.txt index 3a8145796..845cb7d59 100644 --- a/osx/CMakeLists.txt +++ b/osx/CMakeLists.txt @@ -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)