Skip to content

Commit

Permalink
Download resources when they do not exist in source folder (#1277)
Browse files Browse the repository at this point in the history
IB-8136, Fixes #1274

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored Jul 31, 2024
1 parent c7c86b8 commit a857685
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
add_executable( TSLDownload TSLDownload.cpp )
target_link_libraries(TSLDownload Qt${QT_VERSION_MAJOR}::Network)
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
get_target_property(qtCore_install_prefix Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
add_custom_command(
OUTPUT TSL.qrc
DEPENDS TSLDownload
COMMAND $<TARGET_FILE:TSLDownload> "${CMAKE_CURRENT_BINARY_DIR}" ${TSL_URL} ${TSL_INCLUDE}
WORKING_DIRECTORY ${qtCore_install_prefix}
)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/TSL.qrc)
set(TSL_QRC ${CMAKE_CURRENT_SOURCE_DIR}/TSL.qrc)
else()
add_executable(TSLDownload TSLDownload.cpp)
target_link_libraries(TSLDownload Qt${QT_VERSION_MAJOR}::Network)
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
get_target_property(qtCore_install_prefix Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
add_custom_command(
OUTPUT TSL.qrc
DEPENDS TSLDownload
COMMAND $<TARGET_FILE:TSLDownload> "${CMAKE_CURRENT_BINARY_DIR}" ${TSL_URL} ${TSL_INCLUDE}
WORKING_DIRECTORY ${qtCore_install_prefix}
)
set(TSL_QRC ${CMAKE_CURRENT_BINARY_DIR}/TSL.qrc)
endif()

configure_file( translations/tr.qrc tr.qrc COPYONLY )
qt_add_translation(SOURCES translations/en.ts translations/et.ts translations/ru.ts)
Expand All @@ -29,7 +34,7 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
images/images.qrc
fonts/fonts.qrc
${CMAKE_CURRENT_BINARY_DIR}/tr.qrc
${CMAKE_CURRENT_BINARY_DIR}/TSL.qrc
${TSL_QRC}
common_enums.h
main.cpp
Application.cpp
Expand Down
2 changes: 1 addition & 1 deletion common

0 comments on commit a857685

Please sign in to comment.