2015-07-09 06:40:55 +00:00
|
|
|
# Assembles a source/header pair list for use in a DNA library
|
2019-06-12 02:05:17 +00:00
|
|
|
macro(make_dnalist)
|
2021-06-07 19:29:18 +00:00
|
|
|
file(RELATIVE_PATH subdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
set(CMAKE_CURRENT_LIST_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}")
|
|
|
|
foreach (type ${ARGN})
|
|
|
|
get_filename_component(dir ${type} DIRECTORY)
|
|
|
|
if (dir)
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}/${dir}")
|
|
|
|
set(dir "${dir}/")
|
|
|
|
endif ()
|
|
|
|
get_filename_component(name ${type} NAME)
|
|
|
|
list(APPEND DNA_SOURCES "${subdir}/${dir}atdna_${name}.cpp")
|
|
|
|
list(APPEND DNA_HEADERS "${subdir}/${dir}${name}.hpp")
|
|
|
|
endforeach ()
|
2015-07-09 06:40:55 +00:00
|
|
|
endmacro()
|
|
|
|
|
2016-10-07 18:44:45 +00:00
|
|
|
# Assembles source files together for the main DataSpecCommon library
|
|
|
|
macro(dataspec_add_list rel_path a_list)
|
2021-06-07 19:29:18 +00:00
|
|
|
unset(tmp_list)
|
|
|
|
foreach (path IN LISTS ${a_list})
|
|
|
|
if (IS_ABSOLUTE ${path})
|
|
|
|
list(APPEND tmp_list "${path}")
|
|
|
|
else ()
|
|
|
|
list(APPEND tmp_list "${rel_path}/${path}")
|
|
|
|
endif ()
|
|
|
|
endforeach (path)
|
|
|
|
set(${a_list} "${tmp_list}")
|
2016-10-07 18:44:45 +00:00
|
|
|
endmacro(dataspec_add_list)
|
|
|
|
|
2015-07-09 07:15:43 +00:00
|
|
|
# Each game's DNA library
|
2019-06-12 02:05:17 +00:00
|
|
|
unset(DNA_SOURCES)
|
|
|
|
unset(DNA_HEADERS)
|
2016-10-09 07:45:04 +00:00
|
|
|
include(DNACommon/CMakeLists.txt)
|
|
|
|
include(DNAMP1/CMakeLists.txt)
|
|
|
|
include(DNAMP2/CMakeLists.txt)
|
|
|
|
include(DNAMP3/CMakeLists.txt)
|
2015-07-07 03:22:44 +00:00
|
|
|
|
2015-08-04 21:35:41 +00:00
|
|
|
# Embed master shader script
|
2017-12-29 08:08:12 +00:00
|
|
|
bintoc(RetroMasterShader.cpp Blender/RetroMasterShader.py RETRO_MASTER_SHADER)
|
2015-08-04 21:35:41 +00:00
|
|
|
|
2017-07-23 23:45:04 +00:00
|
|
|
# Download asset name databases
|
|
|
|
add_custom_command(OUTPUT AssetNameMap32.bin COMMAND ${CMAKE_COMMAND} ARGS -P
|
2021-06-07 19:29:18 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap32Download.cmake)
|
2020-03-02 06:59:31 +00:00
|
|
|
bintoc_compress(AssetNameMap32.cpp ${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap32.bin ASSET_NAME_MP32)
|
2017-07-13 11:39:52 +00:00
|
|
|
|
2017-07-23 23:45:04 +00:00
|
|
|
add_custom_command(OUTPUT AssetNameMap64.bin COMMAND ${CMAKE_COMMAND} ARGS -P
|
2021-06-07 19:29:18 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap64Download.cmake)
|
2020-03-02 06:59:31 +00:00
|
|
|
bintoc_compress(AssetNameMap64.cpp ${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap64.bin ASSET_NAME_MP64)
|
2017-07-13 11:39:52 +00:00
|
|
|
|
2015-07-09 07:15:43 +00:00
|
|
|
# Each game's DataSpec implementation
|
2015-07-07 03:22:44 +00:00
|
|
|
add_library(RetroDataSpec
|
2021-06-07 19:29:18 +00:00
|
|
|
SpecBase.cpp
|
|
|
|
${DNACOMMON_SOURCES}
|
|
|
|
SpecMP1.cpp
|
|
|
|
${DNAMP1_SOURCES}
|
|
|
|
${ScriptObjectsMP1_SOURCES}
|
|
|
|
${DNAMP1_SFX_SOURCES}
|
|
|
|
SpecMP2.cpp
|
|
|
|
${DNAMP2_SOURCES}
|
|
|
|
SpecMP3.cpp
|
|
|
|
${DNAMP3_SOURCES}
|
|
|
|
Blender/BlenderSupport.hpp
|
|
|
|
Blender/BlenderSupport.cpp
|
|
|
|
Blender/RetroMasterShader.py
|
|
|
|
AssetNameMap.hpp
|
|
|
|
AssetNameMap.cpp
|
|
|
|
RetroMasterShader.cpp)
|
2020-03-02 06:59:31 +00:00
|
|
|
add_library(AssetNameMap
|
|
|
|
AssetNameMap32.bin AssetNameMap32.cpp
|
|
|
|
AssetNameMap64.bin AssetNameMap64.cpp)
|
|
|
|
add_library(AssetNameMapNull
|
|
|
|
AssetNameMapNull.cpp)
|
2019-06-12 02:05:17 +00:00
|
|
|
|
|
|
|
get_target_property(HECL_INCLUDES hecl-full INCLUDE_DIRECTORIES)
|
2021-06-30 20:27:53 +00:00
|
|
|
target_include_directories(RetroDataSpec PUBLIC ${HECL_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR})
|
2022-02-18 00:38:31 +00:00
|
|
|
target_link_libraries(RetroDataSpec PUBLIC amuse zeus nod squish ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} lzokay logvisor aurora xxhash)
|
2021-06-07 19:29:18 +00:00
|
|
|
if (COMMAND add_sanitizers)
|
|
|
|
add_sanitizers(RetroDataSpec)
|
|
|
|
endif ()
|
2019-06-12 02:05:17 +00:00
|
|
|
|
|
|
|
# Resolve all DNA sources into target
|
|
|
|
list(LENGTH DNA_SOURCES count)
|
|
|
|
math(EXPR count "${count}-1")
|
2021-06-07 19:29:18 +00:00
|
|
|
foreach (i RANGE ${count})
|
|
|
|
list(GET DNA_SOURCES ${i} src)
|
|
|
|
list(GET DNA_HEADERS ${i} header)
|
|
|
|
target_atdna(RetroDataSpec ${src} ${header})
|
|
|
|
endforeach ()
|
2019-06-12 02:05:17 +00:00
|
|
|
|
2020-03-02 06:59:31 +00:00
|
|
|
add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<TARGET_PROPERTY:RetroDataSpec,INCLUDE_DIRECTORIES>")
|