1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

fix showing icons in the launcher

kambala-decapitator/vcmi#17
This commit is contained in:
Andrey Filipenkov 2021-04-20 00:23:44 +03:00
parent 67ef0c234d
commit 4c848b8f00
2 changed files with 11 additions and 6 deletions

View File

@ -130,19 +130,20 @@ target_include_directories(vcmilauncher
vcmi_set_output_dir(vcmilauncher "")
enable_pch(vcmilauncher)
# Copy to build directory for easier debugging
add_custom_command(TARGET vcmilauncher POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/launcher/icons ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
)
if(APPLE_IOS)
install(DIRECTORY icons DESTINATION ${DATA_DIR})
add_custom_command(TARGET vcmilauncher POST_BUILD
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmilauncher>"
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/Frameworks $<TARGET_FILE:vcmilauncher> || true
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
)
else()
# Copy to build directory for easier debugging
add_custom_command(TARGET vcmilauncher POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/launcher/icons ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
)
install(TARGETS vcmilauncher DESTINATION ${BIN_DIR})
# copy whole directory
install(DIRECTORY icons DESTINATION ${DATA_DIR}/launcher)

View File

@ -34,9 +34,13 @@ void MainWindow::load()
CResourceHandler::initialize();
CResourceHandler::load("config/filesystem.json");
#ifdef Q_OS_IOS
QDir::addSearchPath("icons", pathToQString(VCMIDirs::get().binaryPath() / "icons"));
#else
for(auto & string : VCMIDirs::get().dataPaths())
QDir::addSearchPath("icons", pathToQString(string / "launcher" / "icons"));
QDir::addSearchPath("icons", pathToQString(VCMIDirs::get().userDataPath() / "launcher" / "icons"));
#endif
settings.init();
}