SRB2/assets/CMakeLists.txt
Ronald Kinard a713509493 Refactor CMake to allow source grouping and separation of interfaces.
Core and SDL2 are two separate targets now. Core is a static library
that is linked into SRB2SDL2. The sources for both are separated.
When using an IDE like Visual Studio or Xcode, the source code
organized into groups that explain what that group of sources does.

In the future, "Main" could be split into a few more groups based on
file prefixes, but I think the way it is set up works for now.

Makefile targets are not affected by source_groups and typing `make`
will automatically compile both the "Core" library and SRB2SDL2
itself.
2015-03-08 03:26:54 -05:00

37 lines
840 B
CMake

## Assets Target Configuration ##
# MD5 generation
set(SRB2_ASSET_ALL
${CMAKE_CURRENT_SOURCE_DIR}/srb2.srb
${CMAKE_CURRENT_SOURCE_DIR}/player.dta
${CMAKE_CURRENT_SOURCE_DIR}/rings.dta
${CMAKE_CURRENT_SOURCE_DIR}/zones.dta
${CMAKE_CURRENT_SOURCE_DIR}/patch.dta
${CMAKE_CURRENT_SOURCE_DIR}/music.dta
)
set(SRB2_ASSET_HASHED
srb2.srb
player.dta
rings.dta
zones.dta
patch.dta
)
foreach(SRB2_ASSET ${SRB2_ASSET_HASHED})
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)
endforeach()
# Installation
if(CLANG)
get_target_property(outname SRB2SDL2 OUTPUT_NAME)
install(FILES ${SRB2_ASSET_ALL}
DESTINATION "${outname}.app/Contents/Resources"
)
else()
install(FILES ${SRB2_ASSET_ALL}
DESTINATION .
)
endif()