@ -113,7 +113,7 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET)
unset ( target_locations )
get_target_property ( target_locations ${ ly_TARGET } ${ imported_property } )
if ( target_locations )
list ( APPEND all_runtime_dependencies ${ target_locations } )
list ( APPEND all_runtime_dependencies "${target_locations}" )
else ( )
# C h e c k i f t h e p r o p e r t y e x i s t s f o r c o n f i g u r a t i o n s
unset ( target_locations )
@ -156,7 +156,7 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET)
endfunction ( )
function ( ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_ TARGET)
function ( ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_ RUNTIME_DEPEND ly_ TARGET)
# T o o p t i m i z e t h i s , w e a r e g o i n g t o c a c h e t h e c o m m a n d s f o r t h e t a r g e t s w e r e q u e s t e d . A l o t o f t a r g e t s e n d u p b e i n g
# d e p e n d e n c i e s o f o t h e r t a r g e t s .
@ -166,6 +166,8 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET)
# W e a l r e a d y w a l k e d t h r o u g h t h i s t a r g e t
get_property ( cached_command GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_COMMAND_ ${ ly_TARGET } )
set ( ${ ly_RUNTIME_COMMAND } ${ cached_command } PARENT_SCOPE )
get_property ( cached_depend GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_DEPEND_ ${ ly_TARGET } )
set ( ${ ly_RUNTIME_DEPEND } "${cached_depend}" PARENT_SCOPE )
return ( )
endif ( )
@ -223,6 +225,8 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET)
set_property ( GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_COMMAND_ ${ ly_TARGET } "${runtime_command}" )
set ( ${ ly_RUNTIME_COMMAND } ${ runtime_command } PARENT_SCOPE )
set_property ( GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_DEPEND_ ${ ly_TARGET } "${source_file}" )
set ( ${ ly_RUNTIME_DEPEND } "${source_file}" PARENT_SCOPE )
endfunction ( )
@ -245,17 +249,20 @@ function(ly_delayed_generate_runtime_dependencies)
unset ( runtime_dependencies )
unset ( LY_COPY_COMMANDS )
unset ( runtime_depends )
ly_get_runtime_dependencies ( runtime_dependencies ${ target } )
foreach ( runtime_dependency ${ runtime_dependencies } )
unset ( runtime_command )
ly_get_runtime_dependency_command ( runtime_command ${ runtime_dependency } )
unset ( runtime_depend )
ly_get_runtime_dependency_command ( runtime_command runtime_depend ${ runtime_dependency } )
string ( APPEND LY_COPY_COMMANDS ${ runtime_command } )
list ( APPEND runtime_depends ${ runtime_depend } )
endforeach ( )
# G e n e r a t e t h e o u t p u t f i l e
# G e n e r a t e t h e o u t p u t f i l e , n o t e t h e S T A M P _ O U T P U T _ F I L E n e e d t o m a t c h w i t h t h e o n e d e f i n e d i n L Y W r a p p e r s . c m a k e
set ( STAMP_OUTPUT_FILE ${ CMAKE_BINARY_DIR } /runtime_dependencies/ $< CONFIG > / ${ target } _ $< CONFIG > .stamp )
set ( target_file_dir "$<TARGET_FILE_DIR:${target}>" )
set ( target_file "$<TARGET_FILE:${target}>" )
ly_file_read ( ${ LY_RUNTIME_DEPENDENCIES_TEMPLATE } template_file )
string ( CONFIGURE "${LY_COPY_COMMANDS}" LY_COPY_COMMANDS @ONLY )
string ( CONFIGURE "${template_file}" configured_template_file @ONLY )
@ -263,6 +270,9 @@ function(ly_delayed_generate_runtime_dependencies)
O U T P U T $ { C M A K E _ B I N A R Y _ D I R } / r u n t i m e _ d e p e n d e n c i e s / $ < C O N F I G > / $ { t a r g e t } . c m a k e
C O N T E N T " $ { c o n f i g u r e d _ t e m p l a t e _ f i l e } "
)
# s e t t h e p r o p e r t y t h a t i s c o n s u m e d f r o m t h e c u s t o m c o m m a n d g e n e r a t e d i n L y W r a p p e r s . c m a k e
set_target_properties ( ${ target } PROPERTIES RUNTIME_DEPENDENCIES_DEPENDS "${runtime_depends}" )
endforeach ( )