-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It probably should be in cmake/ instead of dist/ but this will do for now
- Loading branch information
1 parent
0858041
commit 1bc39db
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(7ZIP_COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" a -tzip -mtc- -mcu+ -mx=9 -r "${PK3_DESTINATION}/slade.pk3" .) | ||
|
||
if(EXISTS "${PK3_DESTINATION}/slade.pk3") | ||
if(WIN32) | ||
set(PLATFORM_GREP_COMMAND findstr "/c:SHA256 for data and names:") | ||
else() | ||
set(PLATFORM_GREP_COMMAND grep "SHA256 for data and names:") | ||
endif() | ||
execute_process(COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" h -scrcsha256 . | ||
COMMAND ${PLATFORM_GREP_COMMAND} | ||
OUTPUT_VARIABLE FOLDER_SHA256 | ||
) | ||
execute_process(COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" t -scrcsha256 "${PK3_DESTINATION}/slade.pk3" | ||
COMMAND ${PLATFORM_GREP_COMMAND} | ||
OUTPUT_VARIABLE PK3_SHA256 | ||
) | ||
if(FOLDER_SHA256 STREQUAL PK3_SHA256) | ||
message(STATUS "slade.pk3 is already up to date.") | ||
else() | ||
file(REMOVE "${PK3_DESTINATION}/slade.pk3") | ||
message(STATUS "Regenerating slade.pk3...") | ||
execute_process(COMMAND ${7ZIP_COMMAND}) | ||
endif() | ||
else() | ||
execute_process(COMMAND ${7ZIP_COMMAND}) | ||
endif() |