2015-01-28 22:42:05 +00:00
|
|
|
## Assets Target Configuration ##
|
|
|
|
|
2018-12-30 20:08:30 +00:00
|
|
|
# For prepending the current source path, later
|
|
|
|
FUNCTION(PREPEND var prefix)
|
|
|
|
SET(listVar "")
|
|
|
|
FOREACH(f ${ARGN})
|
|
|
|
LIST(APPEND listVar "${prefix}/${f}")
|
|
|
|
ENDFOREACH(f)
|
|
|
|
SET(${var} "${listVar}" PARENT_SCOPE)
|
|
|
|
ENDFUNCTION(PREPEND)
|
|
|
|
|
2018-12-31 22:09:59 +00:00
|
|
|
set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer"
|
|
|
|
CACHE STRING "Path to directory that contains all asset files for the installer.")
|
|
|
|
|
2020-06-07 22:35:33 +00:00
|
|
|
set(SRB2_ASSET_INSTALL ON
|
|
|
|
CACHE BOOL "Insert asset files into the install directory or package.")
|
|
|
|
|
2019-12-07 18:04:51 +00:00
|
|
|
####################
|
|
|
|
# POST-V2.2 NOTE: Do not forget to add patch.pk3 to the end of this list!
|
|
|
|
####################
|
|
|
|
|
2018-12-31 22:09:59 +00:00
|
|
|
set(SRB2_ASSET_HASHED
|
2019-09-29 03:31:50 +00:00
|
|
|
"srb2.pk3;\
|
2018-12-30 20:08:30 +00:00
|
|
|
player.dta;\
|
2022-03-06 19:22:22 +00:00
|
|
|
zones.pk3"
|
2018-12-31 22:09:59 +00:00
|
|
|
CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!"
|
2018-12-30 20:08:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(SRB2_ASSET_DOCS
|
|
|
|
"README.txt;\
|
|
|
|
LICENSE.txt;\
|
2019-12-07 18:04:51 +00:00
|
|
|
LICENSE-3RD-PARTY.txt;\
|
|
|
|
README-SDL.txt"
|
2018-12-31 22:09:59 +00:00
|
|
|
CACHE STRING "Documentation filenames. In OS X, these are packaged separately from other assets. No spaces between entries!"
|
2015-01-28 22:42:05 +00:00
|
|
|
)
|
|
|
|
|
2018-12-31 22:09:59 +00:00
|
|
|
PREPEND(SRB2_ASSET_DOCS ${SRB2_ASSET_DIRECTORY} ${SRB2_ASSET_DOCS})
|
2018-12-30 20:08:30 +00:00
|
|
|
|
2015-01-28 22:42:05 +00:00
|
|
|
foreach(SRB2_ASSET ${SRB2_ASSET_HASHED})
|
2018-12-31 22:09:59 +00:00
|
|
|
file(MD5 ${SRB2_ASSET_DIRECTORY}/${SRB2_ASSET} "SRB2_ASSET_${SRB2_ASSET}_HASH")
|
2015-01-29 00:03:41 +00:00
|
|
|
set(SRB2_ASSET_${SRB2_ASSET}_HASH ${SRB2_ASSET_${SRB2_ASSET}_HASH} PARENT_SCOPE)
|
2015-01-28 22:42:05 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
|
2018-12-30 20:08:30 +00:00
|
|
|
if(${CMAKE_SYSTEM} MATCHES Darwin)
|
2015-03-08 08:26:54 +00:00
|
|
|
get_target_property(outname SRB2SDL2 OUTPUT_NAME)
|
2020-06-07 22:35:33 +00:00
|
|
|
if(${SRB2_ASSET_INSTALL})
|
|
|
|
install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/"
|
|
|
|
DESTINATION "${outname}.app/Contents/Resources"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
# Always install the doc files, even in non-asset packages.
|
2018-12-30 20:08:30 +00:00
|
|
|
install(FILES ${SRB2_ASSET_DOCS}
|
|
|
|
DESTINATION .
|
|
|
|
OPTIONAL
|
2015-01-29 01:29:16 +00:00
|
|
|
)
|
|
|
|
else()
|
2020-06-07 22:35:33 +00:00
|
|
|
if(${SRB2_ASSET_INSTALL})
|
|
|
|
install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/"
|
|
|
|
DESTINATION .
|
|
|
|
)
|
|
|
|
# Docs are assumed to be located in SRB2_ASSET_DIRECTORY, so don't install them in their own call.
|
|
|
|
else()
|
|
|
|
# Always install the doc files, even in non-asset packages.
|
|
|
|
install(FILES ${SRB2_ASSET_DOCS}
|
|
|
|
DESTINATION .
|
|
|
|
OPTIONAL
|
|
|
|
)
|
|
|
|
endif()
|
2015-01-29 01:29:16 +00:00
|
|
|
endif()
|