1
0
Fork 0
forked from len0rd/rockbox

rbutil: cmake: Make linuxdeploy download a global target.

That way we won't get duplicated targets when the deploy function is
used for multiple targets.

Change-Id: Ie14fdd74fcc496647c3c041ae2fcf902a3cb15fa
This commit is contained in:
Dominik Riebeling 2021-12-27 16:14:46 +01:00
parent 67942629cf
commit 2ecbc18535

View file

@ -25,26 +25,28 @@ endif()
# Linux: Build AppImage
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
function(deploy_qt target qtbindir iconfile desktopfile dmgbuildcfg)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(WARNING "Deploying a Debug build.")
endif()
set(LINUXDEPLOY ${CMAKE_BINARY_DIR}/linuxdeploy-x86_64.AppImage)
set(LINUXDEPLOYQT ${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage)
add_custom_command(
COMMENT "Downloading linuxdeploy"
OUTPUT ${LINUXDEPLOY}
OUTPUT ${LINUXDEPLOYQT}
${LINUXDEPLOYQT}
COMMAND ${CMAKE_COMMAND}
-DOUTDIR=${CMAKE_BINARY_DIR}
-DURL=https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
-P ${CMAKE_SOURCE_DIR}/cmake/download.cmake
-P ${CMAKE_CURRENT_LIST_DIR}/download.cmake
COMMAND ${CMAKE_COMMAND}
-DOUTDIR=${CMAKE_BINARY_DIR}
-DURL=https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
-P ${CMAKE_SOURCE_DIR}/cmake/download.cmake
-P ${CMAKE_CURRENT_LIST_DIR}/download.cmake
)
# intermediate target needed to be able to get back to the actual file dependency.
add_custom_target(linuxdeploy DEPENDS ${LINUXDEPLOY})
function(deploy_qt target qtbindir iconfile desktopfile dmgbuildcfg)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(WARNING "Deploying a Debug build.")
endif()
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/${target}.AppImage
COMMENT "Creating AppImage ${target}"
@ -57,8 +59,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
--appdir=AppImage-${target}
--output=appimage
--verbosity=2
DEPENDS ${target}
${LINUXDEPLOY}
DEPENDS ${target} linuxdeploy
)
add_custom_target(deploy_${target}
DEPENDS ${CMAKE_BINARY_DIR}/${target}.AppImage)