Unified psemek_package_resources implementation across platforms (always behaves like glob_recurse)
All checks were successful
Run tests / Run tests (push) Successful in 6m53s
All checks were successful
Run tests / Run tests (push) Successful in 6m53s
This commit is contained in:
parent
d5a513285b
commit
091c467d2b
1 changed files with 12 additions and 11 deletions
|
|
@ -213,21 +213,22 @@ endfunction()
|
|||
function(psemek_package_files_impl target as_resources)
|
||||
if(PSEMEK_PACKAGE_MODE)
|
||||
if(PSEMEK_PACKAGE_TARGET)
|
||||
set(_FILES)
|
||||
foreach(_PATTERN IN LISTS ARGN)
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_PATTERN}")
|
||||
list(APPEND _FILES "${_PATTERN}")
|
||||
else()
|
||||
file(GLOB_RECURSE _TEMP_FILES RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${_PATTERN}")
|
||||
list(APPEND _FILES ${_TEMP_FILES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(PSEMEK_PLATFORM_ANDROID AND as_resources)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
COMMAND ${PSEMEK_COPY_FILES} ${ARGN}
|
||||
COMMAND ${PSEMEK_COPY_FILES} ${_FILES}
|
||||
)
|
||||
elseif(PSEMEK_PLATFORM_WEB AND as_resources)
|
||||
set(_FILES)
|
||||
foreach(_PATTERN IN LISTS ARGN)
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_PATTERN}")
|
||||
list(APPEND _FILES "${_PATTERN}")
|
||||
else()
|
||||
file(GLOB_RECURSE _TEMP_FILES RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${_PATTERN}")
|
||||
list(APPEND _FILES ${_TEMP_FILES})
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(_FILE IN LISTS _FILES)
|
||||
message(STATUS "Preloading ${CMAKE_CURRENT_LIST_DIR}/${_FILE} as resources/${_FILE}")
|
||||
target_link_options(${target} PRIVATE
|
||||
|
|
@ -239,7 +240,7 @@ function(psemek_package_files_impl target as_resources)
|
|||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
COMMAND zip -v "${_OUTPUT_PATH}" -r ${ARGN}
|
||||
COMMAND zip -v "${_OUTPUT_PATH}" -r ${_FILES}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue