Skip to content

Commit

Permalink
Use system enviroment var ARCH to decide which appimagetool bin shoul…
Browse files Browse the repository at this point in the history
…d be downloaded
  • Loading branch information
azubieta committed Jul 2, 2019
1 parent a417914 commit 40a267d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ message(STATUS "Generating test data AppImage")
# Get appimagetool
set(APPIMAGETOOL_BIN ${CMAKE_CURRENT_BINARY_DIR}/appimagetool)
if(NOT EXISTS ${APPIMAGETOOL_BIN})
message(STATUS "Downloading appimagetool for ${CMAKE_SYSTEM_PROCESSOR}")
file(DOWNLOAD "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${CMAKE_SYSTEM_PROCESSOR}.AppImage" "${APPIMAGETOOL_BIN}" SHOW_PROGRESS)
if(DEFINED ENV{ARCH} )
set(APPIMAGETOOL_BIN_ARCH $ENV{ARCH})
else()
set(APPIMAGETOOL_BIN_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()

message(STATUS "Downloading appimagetool for ${APPIMAGETOOL_BIN_ARCH}")
file(DOWNLOAD "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${APPIMAGETOOL_BIN_ARCH}.AppImage" "${APPIMAGETOOL_BIN}")

execute_process(COMMAND chmod +x ${APPIMAGETOOL_BIN})
endif()
message(STATUS "Using appimagetool: ${APPIMAGETOOL_BIN}")
Expand Down

0 comments on commit 40a267d

Please sign in to comment.