CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # We need to keep this code into separate directory so CMake will execute it after all other subdirectories install code
  2. # Otherwise we can't fix win bundle dependencies since binaries wouldn't be there when this code executed
  3. # This will likely only work for Vcpkg
  4. if(WIN32)
  5. #there are some weird issues with variables used in path not evaluated properly when trying to remove code duplication from below lines
  6. if(ENABLE_LAUNCHER)
  7. install(CODE "
  8. file(WRITE \"\${CMAKE_INSTALL_PREFIX}/qt.conf\"
  9. \"[Paths]\nPlugins = .\"
  10. )
  11. ")
  12. endif()
  13. #TODO: check if some equivalent of block below can be used for above block (easy qt dependencies copy)
  14. #LuaJIT will not be copied automatically by not meeting criteria for this block of code
  15. if(ENABLE_LUA)
  16. install_vcpkg_imported_tgt(luajit::luajit)
  17. endif()
  18. if(MSVC)
  19. set(gp_tool "dumpbin")
  20. endif()
  21. install(CODE "
  22. set(dirs \"${CMAKE_PREFIX_PATH}\")
  23. if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\")
  24. list(TRANSFORM dirs APPEND \"/debug/bin\")
  25. else()
  26. list(TRANSFORM dirs APPEND \"/bin\")
  27. list(FILTER dirs EXCLUDE REGEX \".*debug.*\")
  28. endif()
  29. set(BU_CHMOD_BUNDLE_ITEMS ON)
  30. set(gp_tool \"${gp_tool}\")
  31. include(BundleUtilities)
  32. fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/VCMI_Client.exe\" \"\" \"\${dirs}\")
  33. " COMPONENT Runtime)
  34. endif(WIN32)