From 76b56cd8b81809fce0a5c2a44e2f6d437591132f Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 15 Jul 2026 12:46:57 -0600 Subject: [PATCH] Forgot to stage this --- cmake/CopyModAssets.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cmake/CopyModAssets.cmake diff --git a/cmake/CopyModAssets.cmake b/cmake/CopyModAssets.cmake new file mode 100644 index 0000000000..ca16da6018 --- /dev/null +++ b/cmake/CopyModAssets.cmake @@ -0,0 +1,10 @@ +# Copies a mod asset directory for packaging, skipping dotfiles and dot-directories +# (.gitkeep, .DS_Store, ...). Usage: cmake -DSRC= -DDST= -P CopyModAssets.cmake +file(MAKE_DIRECTORY "${DST}") +file(GLOB_RECURSE _files RELATIVE "${SRC}" "${SRC}/*") +foreach (_file IN LISTS _files) + if (NOT _file MATCHES "(^|/)\\.") + get_filename_component(_dir "${_file}" DIRECTORY) + file(COPY "${SRC}/${_file}" DESTINATION "${DST}/${_dir}") + endif () +endforeach ()