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:
parent
67942629cf
commit
2ecbc18535
1 changed files with 18 additions and 17 deletions
|
@ -25,26 +25,28 @@ endif()
|
||||||
|
|
||||||
# Linux: Build AppImage
|
# Linux: Build AppImage
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
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(LINUXDEPLOY ${CMAKE_BINARY_DIR}/linuxdeploy-x86_64.AppImage)
|
||||||
set(LINUXDEPLOYQT ${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage)
|
set(LINUXDEPLOYQT ${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
COMMENT "Downloading linuxdeploy"
|
COMMENT "Downloading linuxdeploy"
|
||||||
OUTPUT ${LINUXDEPLOY}
|
OUTPUT ${LINUXDEPLOY}
|
||||||
OUTPUT ${LINUXDEPLOYQT}
|
${LINUXDEPLOYQT}
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DOUTDIR=${CMAKE_BINARY_DIR}
|
-DOUTDIR=${CMAKE_BINARY_DIR}
|
||||||
-DURL=https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
-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}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DOUTDIR=${CMAKE_BINARY_DIR}
|
-DOUTDIR=${CMAKE_BINARY_DIR}
|
||||||
-DURL=https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
-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(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/${target}.AppImage
|
OUTPUT ${CMAKE_BINARY_DIR}/${target}.AppImage
|
||||||
COMMENT "Creating AppImage ${target}"
|
COMMENT "Creating AppImage ${target}"
|
||||||
|
@ -57,8 +59,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
--appdir=AppImage-${target}
|
--appdir=AppImage-${target}
|
||||||
--output=appimage
|
--output=appimage
|
||||||
--verbosity=2
|
--verbosity=2
|
||||||
DEPENDS ${target}
|
DEPENDS ${target} linuxdeploy
|
||||||
${LINUXDEPLOY}
|
|
||||||
)
|
)
|
||||||
add_custom_target(deploy_${target}
|
add_custom_target(deploy_${target}
|
||||||
DEPENDS ${CMAKE_BINARY_DIR}/${target}.AppImage)
|
DEPENDS ${CMAKE_BINARY_DIR}/${target}.AppImage)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue