|
@ -63,12 +63,21 @@ macro(eth_add_test NAME) |
|
|
endmacro() |
|
|
endmacro() |
|
|
|
|
|
|
|
|
# Creates C resources file from files |
|
|
# Creates C resources file from files |
|
|
function(eth_add_resources TARGET RESOURCE_FILE) |
|
|
function(eth_add_resources RESOURCE_FILE OUT_FILE) |
|
|
|
|
|
include("${RESOURCE_FILE}") |
|
|
|
|
|
set(OUTPUT "${ETH_RESOURCE_LOCATION}/${ETH_RESOURCE_NAME}.hpp") |
|
|
|
|
|
set(${OUT_FILE} "${OUTPUT}" PARENT_SCOPE) |
|
|
|
|
|
|
|
|
add_custom_target("${TARGET}.resources" |
|
|
set(filenames "${RESOURCE_FILE}") |
|
|
COMMAND ${CMAKE_COMMAND} -DETH_RES_FILE="${RESOURCE_FILE}" -P "${ETH_SCRIPTS_DIR}/resources.cmake" |
|
|
list(APPEND filenames "${ETH_SCRIPTS_DIR}/resources.cmake") |
|
|
) |
|
|
foreach(resource ${ETH_RESOURCES}) |
|
|
|
|
|
list(APPEND filenames "${${resource}}") |
|
|
|
|
|
endforeach(resource) |
|
|
|
|
|
|
|
|
add_dependencies(${TARGET} "${TARGET}.resources") |
|
|
message(STATUS "filenames; ${filenames}") |
|
|
|
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${OUTPUT} |
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DETH_RES_FILE="${RESOURCE_FILE}" -P "${ETH_SCRIPTS_DIR}/resources.cmake" |
|
|
|
|
|
DEPENDS ${filenames} |
|
|
|
|
|
) |
|
|
endfunction() |
|
|
endfunction() |
|
|