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)
|
|
|
|
|
|
|
|
set(SRB2_ASSET_REQUIRED
|
|
|
|
"srb2.srb;\
|
|
|
|
player.dta;\
|
|
|
|
rings.dta;\
|
|
|
|
zones.dta;\
|
|
|
|
patch.dta"
|
|
|
|
CACHE STRING "Required asset files for packaging. No spaces between entries!"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SRB2_ASSET_DOCS
|
|
|
|
"README.txt;\
|
|
|
|
LICENSE.txt;\
|
|
|
|
LICENSE-3RD-PARTY.txt"
|
|
|
|
CACHE STRING "Documentation files; will not fail if they do not exist. Packaged differently from optional assets. No spaces between entries!"
|
2015-01-28 22:42:05 +00:00
|
|
|
)
|
|
|
|
|
2018-12-30 20:08:30 +00:00
|
|
|
set(SRB2_ASSET_OPTIONAL
|
|
|
|
"music.dta"
|
|
|
|
CACHE STRING "Optional asset files. No spaces between entries!"
|
|
|
|
)
|
|
|
|
|
|
|
|
# MD5 generation - Filename only, we don't append path to this
|
2015-01-28 22:42:05 +00:00
|
|
|
set(SRB2_ASSET_HASHED
|
2018-12-30 20:08:30 +00:00
|
|
|
${SRB2_ASSET_REQUIRED}
|
2015-01-28 22:42:05 +00:00
|
|
|
)
|
|
|
|
|
2018-12-30 20:08:30 +00:00
|
|
|
PREPEND(SRB2_ASSET_REQUIRED ${CMAKE_CURRENT_SOURCE_DIR} ${SRB2_ASSET_REQUIRED})
|
|
|
|
PREPEND(SRB2_ASSET_DOCS ${CMAKE_CURRENT_SOURCE_DIR} ${SRB2_ASSET_DOCS})
|
|
|
|
PREPEND(SRB2_ASSET_OPTIONAL ${CMAKE_CURRENT_SOURCE_DIR} ${SRB2_ASSET_OPTIONAL})
|
|
|
|
|
2015-01-28 22:42:05 +00:00
|
|
|
foreach(SRB2_ASSET ${SRB2_ASSET_HASHED})
|
2015-01-29 00:03:41 +00:00
|
|
|
file(MD5 ${CMAKE_CURRENT_SOURCE_DIR}/${SRB2_ASSET} "SRB2_ASSET_${SRB2_ASSET}_HASH")
|
|
|
|
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-30 20:08:30 +00:00
|
|
|
install(FILES ${SRB2_ASSET_REQUIRED}
|
|
|
|
DESTINATION "${outname}.app/Contents/Resources"
|
|
|
|
)
|
|
|
|
install(FILES ${SRB2_ASSET_OPTIONAL}
|
2015-01-29 01:29:16 +00:00
|
|
|
DESTINATION "${outname}.app/Contents/Resources"
|
2018-12-30 20:08:30 +00:00
|
|
|
OPTIONAL
|
|
|
|
)
|
|
|
|
install(FILES ${SRB2_ASSET_DOCS}
|
|
|
|
DESTINATION .
|
|
|
|
OPTIONAL
|
2015-01-29 01:29:16 +00:00
|
|
|
)
|
|
|
|
else()
|
2018-12-30 20:08:30 +00:00
|
|
|
install(FILES ${SRB2_ASSET_REQUIRED}
|
|
|
|
DESTINATION .
|
|
|
|
)
|
|
|
|
install(FILES ${SRB2_ASSET_OPTIONAL}
|
|
|
|
DESTINATION .
|
|
|
|
OPTIONAL
|
|
|
|
)
|
|
|
|
install(FILES ${SRB2_ASSET_DOCS}
|
2015-01-29 01:29:16 +00:00
|
|
|
DESTINATION .
|
2018-12-30 20:08:30 +00:00
|
|
|
OPTIONAL
|
2015-01-29 01:29:16 +00:00
|
|
|
)
|
|
|
|
endif()
|