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.")
|
|
|
|
|
|
|
|
set(SRB2_ASSET_HASHED
|
2018-12-30 20:08:30 +00:00
|
|
|
"srb2.srb;\
|
|
|
|
player.dta;\
|
|
|
|
rings.dta;\
|
|
|
|
zones.dta;\
|
|
|
|
patch.dta"
|
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;\
|
|
|
|
LICENSE-3RD-PARTY.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)
|
2018-12-31 22:09:59 +00:00
|
|
|
install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/"
|
2018-12-30 20:08:30 +00:00
|
|
|
DESTINATION "${outname}.app/Contents/Resources"
|
|
|
|
)
|
|
|
|
install(FILES ${SRB2_ASSET_DOCS}
|
|
|
|
DESTINATION .
|
|
|
|
OPTIONAL
|
2015-01-29 01:29:16 +00:00
|
|
|
)
|
|
|
|
else()
|
2018-12-31 22:09:59 +00:00
|
|
|
install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/"
|
2015-01-29 01:29:16 +00:00
|
|
|
DESTINATION .
|
|
|
|
)
|
2018-12-31 22:09:59 +00:00
|
|
|
# Docs are assumed to be located in SRB2_ASSET_DIRECTORY, so don't install again
|
|
|
|
#install(FILES ${SRB2_ASSET_DOCS}
|
|
|
|
# DESTINATION .
|
|
|
|
# OPTIONAL
|
|
|
|
#)
|
2015-01-29 01:29:16 +00:00
|
|
|
endif()
|