mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-28 20:43:37 +01:00
cmake: provide a function to set up assets' language and dependencies
This commit is contained in:
parent
4e1e3c86b4
commit
0902fdc904
2 changed files with 19 additions and 9 deletions
|
@ -26,15 +26,7 @@ set(ASSETS_cg
|
||||||
# ...
|
# ...
|
||||||
)
|
)
|
||||||
|
|
||||||
set_source_files_properties(${ASSETS} PROPERTIES
|
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
|
||||||
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets/fxconv-metadata.txt")
|
|
||||||
set_source_files_properties(${ASSETS_fx} PROPERTIES
|
|
||||||
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets-fx/fxconv-metadata.txt")
|
|
||||||
set_source_files_properties(${ASSETS_cg} PROPERTIES
|
|
||||||
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets-cg/fxconv-metadata.txt")
|
|
||||||
|
|
||||||
set_source_files_properties(${ASSETS} ${ASSETS_fx} ${ASSETS_cg}
|
|
||||||
PROPERTIES LANGUAGE FXCONV)
|
|
||||||
|
|
||||||
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
|
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
|
||||||
target_link_libraries(myaddin Gint::Gint)
|
target_link_libraries(myaddin Gint::Gint)
|
||||||
|
|
|
@ -1,2 +1,20 @@
|
||||||
set(CMAKE_FXCONV_COMPILE_OBJECT
|
set(CMAKE_FXCONV_COMPILE_OBJECT
|
||||||
"fxconv <SOURCE> -o <OBJECT> --toolchain=sh-elf --${FXSDK_PLATFORM}")
|
"fxconv <SOURCE> -o <OBJECT> --toolchain=sh-elf --${FXSDK_PLATFORM}")
|
||||||
|
|
||||||
|
function(fxconv_declare_assets)
|
||||||
|
cmake_parse_arguments(CONV "WITH_METADATA" "" "" ${ARGN})
|
||||||
|
|
||||||
|
foreach(ASSET IN LISTS CONV_UNPARSED_ARGUMENTS)
|
||||||
|
# Declare this source file as an FXCONV object
|
||||||
|
set_source_files_properties("${ASSET}" PROPERTIES LANGUAGE FXCONV)
|
||||||
|
|
||||||
|
# Set up a dependency to the local fxconv-metadata.txt
|
||||||
|
if(DEFINED CONV_WITH_METADATA)
|
||||||
|
get_filename_component(DIR "${ASSET}" DIRECTORY)
|
||||||
|
set(METADATA "${DIR}/fxconv-metadata.txt")
|
||||||
|
get_filename_component(METADATA "${METADATA}" ABSOLUTE
|
||||||
|
BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set_source_files_properties("${ASSET}" PROPERTIES OBJECT_DEPENDS "${METADATA}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
|
Loading…
Reference in a new issue