mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
Fix development build using system js resources
Copy native resources to build directory on all platforms
This commit is contained in:
1 parent
8f0b1e4e0e
commit
0294ada0b9
2 files changed
+8
-20
No files matched your search
@@ -14,38 +14,26 @@ function(copy_resources target)
|
||||
if(XCODE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
get_property(RESOURCE_LIST GLOBAL PROPERTY _${target}_RESOURCE_LIST)
|
||||
|
||||
if(RESOURCE_LIST)
|
||||
set_policy(CMP0026 OLD)
|
||||
|
||||
# we read the LOCATION from the target instead of using a generator
|
||||
# here since add_custom_command doesn't support generator expresessions
|
||||
# in the output field, and this is still cleaner than hardcoding the path
|
||||
# of the output binary.
|
||||
#
|
||||
get_property(TARGET_LOC TARGET ${target} PROPERTY LOCATION)
|
||||
get_filename_component(TARGET_DIR ${TARGET_LOC} DIRECTORY)
|
||||
# Use generator expression instead of deprecated LOCATION property
|
||||
if(APPLE)
|
||||
set(TARGET_LOC ${TARGET_DIR}/..)
|
||||
set(TARGET_LOC $<TARGET_FILE_DIR:${target}>/..)
|
||||
else()
|
||||
set(TARGET_LOC ${TARGET_DIR})
|
||||
set(TARGET_LOC $<TARGET_FILE_DIR:${target}>)
|
||||
endif()
|
||||
|
||||
foreach(RF ${RESOURCE_LIST})
|
||||
string(REPLACE "|" ";" PARTS "${RF}")
|
||||
list(GET PARTS 0 SOURCE_FILE)
|
||||
list(GET PARTS 1 _TARGET_FILE)
|
||||
set(TARGET_FILE ${TARGET_LOC}/${_TARGET_FILE})
|
||||
add_custom_command(OUTPUT ${TARGET_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_FILE}" "${TARGET_FILE}"
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_FILE}" "${TARGET_LOC}/${_TARGET_FILE}"
|
||||
DEPENDS ${SOURCE_FILE}
|
||||
COMMENT "CopyResource (${target}): ${TARGET_FILE}")
|
||||
list(APPEND RESOURCES ${TARGET_FILE})
|
||||
COMMENT "CopyResource (${target}): ${_TARGET_FILE}")
|
||||
endforeach()
|
||||
add_custom_target(${target}_CopyResources DEPENDS ${RESOURCES})
|
||||
add_dependencies(${target} ${target}_CopyResources)
|
||||
endif(RESOURCE_LIST)
|
||||
endfunction()
|
||||
|
||||
|
||||
Reference in new issue
Block a user