Skip to content

Commit

Permalink
Merge pull request #118 from colobot/dev-wget-replacement
Browse files Browse the repository at this point in the history
Replaced downloading using wget with CMake's FILE(DOWNLOAD)
  • Loading branch information
tomaszkax86 authored Sep 15, 2024
2 parents b394e46 + 66c9a8d commit 6f4c3de
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions music/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ if(MUSIC)
)
endif()

find_program(WGET wget)

foreach(FILE ${MUSIC_FILES})
get_filename_component(FILENAME ${FILE} NAME_WE)

Expand All @@ -73,14 +71,10 @@ if(MUSIC)
message(STATUS "Music file ${DOWNLOAD_FILE} already downloaded")
set(DOWNLOAD_FILE_LOC "${CMAKE_CURRENT_SOURCE_DIR}/${DOWNLOAD_FILE}")
else()
if(NOT WGET)
message(FATAL_ERROR "wget not found, music files can't be downloaded!")
endif()

execute_process(
COMMAND ${CMAKE_COMMAND} -E echo "Downloading ${DOWNLOAD_FILE}..."
COMMAND ${WGET} -N "https://colobot.info/files/music/${DOWNLOAD_FILE}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
message(STATUS "Downloading ${DOWNLOAD_FILE}...")
file(DOWNLOAD
"https://colobot.info/files/music/${DOWNLOAD_FILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/${DOWNLOAD_FILE}"
)

set(DOWNLOAD_FILE_LOC "${CMAKE_CURRENT_SOURCE_DIR}/${DOWNLOAD_FILE}")
Expand Down

0 comments on commit 6f4c3de

Please sign in to comment.