Skip to content

Commit a857685

Browse files
authored
Download resources when they do not exist in source folder (#1277)
IB-8136, Fixes #1274 Signed-off-by: Raul Metsma <[email protected]>
1 parent c7c86b8 commit a857685

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

client/CMakeLists.txt

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
add_executable( TSLDownload TSLDownload.cpp )
2-
target_link_libraries(TSLDownload Qt${QT_VERSION_MAJOR}::Network)
3-
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
4-
get_target_property(qtCore_install_prefix Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
5-
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
6-
add_custom_command(
7-
OUTPUT TSL.qrc
8-
DEPENDS TSLDownload
9-
COMMAND $<TARGET_FILE:TSLDownload> "${CMAKE_CURRENT_BINARY_DIR}" ${TSL_URL} ${TSL_INCLUDE}
10-
WORKING_DIRECTORY ${qtCore_install_prefix}
11-
)
1+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/TSL.qrc)
2+
set(TSL_QRC ${CMAKE_CURRENT_SOURCE_DIR}/TSL.qrc)
3+
else()
4+
add_executable(TSLDownload TSLDownload.cpp)
5+
target_link_libraries(TSLDownload Qt${QT_VERSION_MAJOR}::Network)
6+
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
7+
get_target_property(qtCore_install_prefix Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
8+
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
9+
add_custom_command(
10+
OUTPUT TSL.qrc
11+
DEPENDS TSLDownload
12+
COMMAND $<TARGET_FILE:TSLDownload> "${CMAKE_CURRENT_BINARY_DIR}" ${TSL_URL} ${TSL_INCLUDE}
13+
WORKING_DIRECTORY ${qtCore_install_prefix}
14+
)
15+
set(TSL_QRC ${CMAKE_CURRENT_BINARY_DIR}/TSL.qrc)
16+
endif()
1217

1318
configure_file( translations/tr.qrc tr.qrc COPYONLY )
1419
qt_add_translation(SOURCES translations/en.ts translations/et.ts translations/ru.ts)
@@ -29,7 +34,7 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
2934
images/images.qrc
3035
fonts/fonts.qrc
3136
${CMAKE_CURRENT_BINARY_DIR}/tr.qrc
32-
${CMAKE_CURRENT_BINARY_DIR}/TSL.qrc
37+
${TSL_QRC}
3338
common_enums.h
3439
main.cpp
3540
Application.cpp

common

0 commit comments

Comments
 (0)