@ -18,6 +18,7 @@ ly_set(LY_DEFAULT_INSTALL_COMPONENT "Core")
# \ a r g : N A M E n a m e o f t h e t a r g e t
# \ a r g : C O M P O N E N T t h e g r o u p i n g s t r i n g o f t h e t a r g e t u s e d f o r s p l i t t i n g u p t h e i n s t a l l
# i n t o s m a l l e r p a c k a g e s .
# A l l o t h e r p a r a m e t e r s a r e f o r w a r d e d t o l y _ g e n e r a t e _ t a r g e t _ f i n d _ f i l e
function ( ly_install_target ly_install_target_NAME )
set ( options )
@ -39,27 +40,41 @@ function(ly_install_target ly_install_target_NAME)
string ( APPEND include_location "/${relative_path}" )
endif ( )
ly_generate_target_find_file (
N A M E $ { l y _ i n s t a l l _ t a r g e t _ N A M E }
$ { A R G N }
)
# G e t t h e o u t p u t f o l d e r s , a r c h i v e i s a l w a y s t h e s a m e , b u t r u n t i m e / l i b r a r y c a n b e i n s u b f o l d e r s d e f i n e d p e r t a r g e t
file ( RELATIVE_PATH archive_output_directory ${ CMAKE_BINARY_DIR } ${ CMAKE_ARCHIVE_OUTPUT_DIRECTORY } )
get_target_property ( target_runtime_output_directory ${ ly_install_target_NAME } RUNTIME_OUTPUT_DIRECTORY )
if ( target_runtime_output_directory )
file ( RELATIVE_PATH target_runtime_output_subdirectory ${ CMAKE_RUNTIME_OUTPUT_DIRECTORY } ${ target_runtime_output_directory } )
endif ( )
file ( RELATIVE_PATH runtime_output_directory ${ CMAKE_BINARY_DIR } ${ CMAKE_RUNTIME_OUTPUT_DIRECTORY } )
get_target_property ( target_library_output_directory ${ ly_install_target_NAME } LIBRARY_OUTPUT_DIRECTORY )
if ( target_library_output_directory )
file ( RELATIVE_PATH target_library_output_subdirectory ${ CMAKE_LIBRARY_OUTPUT_DIRECTORY } ${ target_library_output_directory } )
endif ( )
file ( RELATIVE_PATH library_output_directory ${ CMAKE_BINARY_DIR } ${ CMAKE_LIBRARY_OUTPUT_DIRECTORY } )
install (
T A R G E T S $ { l y _ i n s t a l l _ t a r g e t _ N A M E }
L I B R A R Y
D E S T I N A T I O N l i b / $ < C O N F I G >
C O M P O N E N T $ { l y _ i n s t a l l _ t a r g e t _ C O M P O N E N T }
A R C H I V E
D E S T I N A T I O N l i b / $ < C O N F I G >
D E S T I N A T I O N $ { a r c h i v e _ o u t p u t _ d i r e c t o r y } / $ { P A L _ P L A T F O R M _ N A M E } / $ < C O N F I G >
C O M P O N E N T $ { l y _ i n s t a l l _ t a r g e t _ C O M P O N E N T }
L I B R A R Y
D E S T I N A T I O N $ { l i b r a r y _ o u t p u t _ d i r e c t o r y } / $ { P A L _ P L A T F O R M _ N A M E } / $ < C O N F I G > / $ { t a r g e t _ l i b r a r y _ o u t p u t _ s u b d i r e c t o r y }
C O M P O N E N T $ { l y _ i n s t a l l _ t a r g e t _ C O M P O N E N T }
R U N T I M E
D E S T I N A T I O N b i n / $ < C O N F I G >
D E S T I N A T I O N ${ r u n t i m e _ o u t p u t _ d i r e c t o r y } / $ { P A L _ P L A T F O R M _ N A M E } / $ < C O N F I G > / $ { t a r g e t _ r u n t i m e _ o u t p u t _ s u b d i r e c t o r y }
C O M P O N E N T $ { l y _ i n s t a l l _ t a r g e t _ C O M P O N E N T }
P U B L I C _ H E A D E R
D E S T I N A T I O N $ { i n c l u d e _ l o c a t i o n }
C O M P O N E N T $ { l y _ i n s t a l l _ t a r g e t _ C O M P O N E N T }
)
ly_generate_target_find_file (
N A M E $ { l y _ i n s t a l l _ t a r g e t _ N A M E }
$ { A R G N }
)
ly_generate_target_config_file ( ${ ly_install_target_NAME } )
install ( FILES "${CMAKE_CURRENT_BINARY_DIR}/${ly_install_target_NAME}_$<CONFIG>.cmake"
D E S T I N A T I O N c m a k e _ a u t o g e n / $ { l y _ i n s t a l l _ t a r g e t _ N A M E }
@ -134,26 +149,27 @@ function(ly_generate_target_config_file NAME)
get_target_property ( target_type ${ NAME } TYPE )
un set( target_file_contents )
set( target_file_contents "# Generated by O3DE install\n\n" )
if ( NOT target_type STREQUAL INTERFACE_LIBRARY )
set ( BINARY_DIR_OUTPUTS EXECUTABLE APPLICATION )
set ( target_file_contents "" )
if ( ${ target_type } IN_LIST BINARY_DIR_OUTPUTS )
set ( out_file_generator TARGET_FILE_NAME )
set ( out_dir bin )
else ( )
set ( out_file_generator TARGET_LINKER_FILE_NAME )
set ( out_dir lib )
unset ( target_location )
set ( runtime_types EXECUTABLE APPLICATION )
if ( target_type IN_LIST runtime_types )
string ( APPEND target_location "\" \${LY_ROOT_FOLDER}/${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory}/$<TARGET_FILE_NAME:${NAME}>\"")
elseif ( target_type STREQUAL MODULE_LIBRARY )
string ( APPEND target_location "\" \${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}/$<TARGET_FILE_NAME:${NAME}>\"")
elseif ( target_type STREQUAL SHARED_LIBRARY )
string ( APPEND target_location "\" \${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/$<TARGET_LINKER_FILE_NAME:${NAME}>\"")
string ( APPEND target_file_contents "ly_add_dependencies(${NAME} \" \${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}/$<TARGET_FILE_NAME:${NAME}>\")\n")
else ( ) # S T A T I C _ L I B R A R Y , O B J E C T _ L I B R A R Y , I N T E R F A C E _ L I B R A R Y
string ( APPEND target_location "\" \${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/$<TARGET_LINKER_FILE_NAME:${NAME}>\"")
endif ( )
string ( APPEND target_file_contents
" # G e n e r a t e d b y O 3 D E i n s t a l l
set ( target_location \"\${LY_ROOT_FOLDER}/${out_dir}/$<CONFIG>/$<${out_file_generator}:${NAME}>\")
set_target_properties ( ${ NAME }
string ( APPEND target_file_contents
" set ( target_location ${ target_location } )
set_target_properties ( ${ NAME }
P R O P E R T I E S
$ < $ < C O N F I G : p r o f i l e > : I M P O R T E D _ L O C A T I O N \ " \ $ { t a r g e t _ l o c a t i o n } > \"
$ < $ < C O N F I G : p r o f i l e > : I M P O R T E D _ L O C A T I O N \ " \ $ { t a r g e t _ l o c a t i o n } \ " >
I M P O R T E D _ L O C A T I O N _ $ < U P P E R _ C A S E : $ < C O N F I G > > \ " \ $ { t a r g e t _ l o c a t i o n } \ "
)
if ( EXISTS \"\${target_location}\")
@ -270,7 +286,7 @@ endfunction()
function ( ly_setup_others )
# L i s t o f d i r e c t o r i e s w e w a n t t o i n s t a l l r e l a t i v e t o e n g i n e r o o t
set ( DIRECTORIES_TO_INSTALL Tools/LyTestTools Tools/RemoteConsole ctest_scripts scripts)
set ( DIRECTORIES_TO_INSTALL Tools/LyTestTools Tools/RemoteConsole scripts)
foreach ( dir ${ DIRECTORIES_TO_INSTALL } )
get_filename_component ( install_path ${ dir } DIRECTORY )