[cpack_installer] replaced LY_DEFAULT_INSTALL_COMPONENT with built-in CMAKE_INSTALL_DEFAULT_COMPONENT_NAME. updated stale references to ly_install_target_COMPONENT with a get_prop call

main
scottr 5 years ago
parent 3f9811e498
commit b09f73378f

@ -291,7 +291,6 @@ function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
# Install the Find file to our <install_location>/cmake directory # Install the Find file to our <install_location>/cmake directory
install(FILES ${CMAKE_CURRENT_LIST_FILE} install(FILES ${CMAKE_CURRENT_LIST_FILE}
DESTINATION cmake DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# We only want to install external targets that are part of our source tree # We only want to install external targets that are part of our source tree
@ -302,7 +301,6 @@ function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
get_filename_component(rel_path ${rel_path} DIRECTORY) get_filename_component(rel_path ${rel_path} DIRECTORY)
install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY} install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY}
DESTINATION ${rel_path} DESTINATION ${rel_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endif() endif()

@ -101,7 +101,7 @@ endif()
install(FILES ${_cmake_package_dest} install(FILES ${_cmake_package_dest}
DESTINATION ./Tools/Redistributables/CMake DESTINATION ./Tools/Redistributables/CMake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
) )
# IMPORTANT: required to be included AFTER setting all property overrides # IMPORTANT: required to be included AFTER setting all property overrides
@ -141,7 +141,7 @@ endfunction()
# configure ALL components here # configure ALL components here
ly_configure_cpack_component( ly_configure_cpack_component(
${LY_DEFAULT_INSTALL_COMPONENT} REQUIRED ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} REQUIRED
DISPLAY_NAME "${PROJECT_NAME} Core" DISPLAY_NAME "${PROJECT_NAME} Core"
DESCRIPTION "${PROJECT_NAME} Headers, Libraries and Tools" DESCRIPTION "${PROJECT_NAME} Headers, Libraries and Tools"
) )

@ -11,7 +11,7 @@
set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise
ly_set(LY_DEFAULT_INSTALL_COMPONENT Core) ly_set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
file(RELATIVE_PATH runtime_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) file(RELATIVE_PATH runtime_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
file(RELATIVE_PATH library_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) file(RELATIVE_PATH library_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
@ -27,6 +27,12 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
# De-alias target name # De-alias target name
ly_de_alias_target(${ALIAS_TARGET_NAME} TARGET_NAME) ly_de_alias_target(${ALIAS_TARGET_NAME} TARGET_NAME)
# get the component ID. if the property isn't set for the target, fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_target_property(install_componet ${TARGET_NAME} INSTALL_COMPONENT)
if("${install_componet}" STREQUAL "install_componet-NOTFOUND")
unset(install_componet)
endif()
# All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that # All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that
# we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the # we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the
# headers end up in one folder instead of duplicating the folder structure of the public/interface include directory. # headers end up in one folder instead of duplicating the folder structure of the public/interface include directory.
@ -41,7 +47,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
unset(current_public_headers) unset(current_public_headers)
install(DIRECTORY ${include_directory} install(DIRECTORY ${include_directory}
DESTINATION ${include_location}/${target_source_dir} DESTINATION ${include_location}/${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
FILES_MATCHING FILES_MATCHING
PATTERN *.h PATTERN *.h
PATTERN *.hpp PATTERN *.hpp
@ -68,13 +74,13 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
TARGETS ${TARGET_NAME} TARGETS ${TARGET_NAME}
ARCHIVE ARCHIVE
DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG> DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
LIBRARY LIBRARY
DESTINATION ${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory} DESTINATION ${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
RUNTIME RUNTIME
DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory} DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory}
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
) )
# CMakeLists.txt file # CMakeLists.txt file
@ -182,7 +188,7 @@ set_property(TARGET ${TARGET_NAME}
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}") file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake"
DESTINATION ${target_source_dir} DESTINATION ${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
) )
# Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target # Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target
@ -239,9 +245,13 @@ function(ly_setup_subdirectory absolute_target_source_dir)
"\n" "\n"
"${CREATE_ALIASES_PLACEHOLDER}" "${CREATE_ALIASES_PLACEHOLDER}"
) )
# get the component ID. if the property isn't set for the directory, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_property(install_componet DIRECTORY ${absolute_target_source_dir} PROPERTY INSTALL_COMPONENT)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/CMakeLists.txt" install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/CMakeLists.txt"
DESTINATION ${target_source_dir} DESTINATION ${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT} COMPONENT ${install_componet}
) )
endfunction() endfunction()
@ -262,7 +272,6 @@ function(ly_setup_cmake_install)
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake" install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE PATTERN "__pycache__" EXCLUDE
REGEX "Findo3de.cmake" EXCLUDE REGEX "Findo3de.cmake" EXCLUDE
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
@ -290,7 +299,6 @@ function(ly_setup_cmake_install)
"${LY_ROOT_FOLDER}/CMakeLists.txt" "${LY_ROOT_FOLDER}/CMakeLists.txt"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json" "${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Collect all Find files that were added with ly_add_external_target_path # Collect all Find files that were added with ly_add_external_target_path
@ -303,7 +311,6 @@ function(ly_setup_cmake_install)
endforeach() endforeach()
install(FILES ${additional_find_files} install(FILES ${additional_find_files}
DESTINATION cmake/3rdParty DESTINATION cmake/3rdParty
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all # Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all
@ -320,7 +327,6 @@ function(ly_setup_cmake_install)
configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY) configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake" install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
DESTINATION cmake DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# BuiltInPackage_<platform>.cmake: since associations could happen in any cmake file across the engine. We collect # BuiltInPackage_<platform>.cmake: since associations could happen in any cmake file across the engine. We collect
@ -340,7 +346,6 @@ function(ly_setup_cmake_install)
) )
install(FILES "${pal_builtin_file}" install(FILES "${pal_builtin_file}"
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME} DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endfunction() endfunction()
@ -362,7 +367,6 @@ endfunction()
function(ly_copy source_file target_directory) function(ly_copy source_file target_directory)
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS}) file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
endfunction()" endfunction()"
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
unset(runtime_commands) unset(runtime_commands)
@ -408,7 +412,6 @@ endfunction()"
list(REMOVE_DUPLICATES runtime_commands) list(REMOVE_DUPLICATES runtime_commands)
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
install(CODE "${runtime_commands_str}" install(CODE "${runtime_commands_str}"
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endfunction() endfunction()
@ -427,7 +430,6 @@ function(ly_setup_others)
install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}" install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}"
DESTINATION ${install_path} DESTINATION ${install_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE PATTERN "__pycache__" EXCLUDE
) )
@ -438,7 +440,6 @@ function(ly_setup_others)
install(FILES install(FILES
${o3de_scripts} ${o3de_scripts}
DESTINATION ./scripts DESTINATION ./scripts
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
install(DIRECTORY install(DIRECTORY
@ -446,7 +447,6 @@ function(ly_setup_others)
${LY_ROOT_FOLDER}/scripts/project_manager ${LY_ROOT_FOLDER}/scripts/project_manager
${LY_ROOT_FOLDER}/scripts/o3de ${LY_ROOT_FOLDER}/scripts/o3de
DESTINATION ./scripts DESTINATION ./scripts
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE PATTERN "__pycache__" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "tests" EXCLUDE PATTERN "tests" EXCLUDE
@ -454,7 +454,6 @@ function(ly_setup_others)
install(DIRECTORY "${LY_ROOT_FOLDER}/python" install(DIRECTORY "${LY_ROOT_FOLDER}/python"
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
REGEX "downloaded_packages" EXCLUDE REGEX "downloaded_packages" EXCLUDE
REGEX "runtime" EXCLUDE REGEX "runtime" EXCLUDE
) )
@ -463,19 +462,16 @@ function(ly_setup_others)
install(DIRECTORY install(DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/Registry ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/Registry
DESTINATION ./${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG> DESTINATION ./${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
install(DIRECTORY install(DIRECTORY
${LY_ROOT_FOLDER}/Registry ${LY_ROOT_FOLDER}/Registry
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Engine Source Assets # Engine Source Assets
install(DIRECTORY install(DIRECTORY
${LY_ROOT_FOLDER}/Assets ${LY_ROOT_FOLDER}/Assets
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Gem Source Assets and Registry # Gem Source Assets and Registry
@ -495,7 +491,6 @@ function(ly_setup_others)
# the "Assets" folder from being copied underneath the <gem-root>/Assets folder # the "Assets" folder from being copied underneath the <gem-root>/Assets folder
install(DIRECTORY ${gem_abs_assets_path} install(DIRECTORY ${gem_abs_assets_path}
DESTINATION ${gem_assets_path} DESTINATION ${gem_assets_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endif() endif()
endforeach() endforeach()
@ -511,7 +506,6 @@ function(ly_setup_others)
get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY) get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY)
install(FILES ${gem_json_path} install(FILES ${gem_json_path}
DESTINATION ${gem_relative_path} DESTINATION ${gem_relative_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endforeach() endforeach()
@ -519,14 +513,12 @@ function(ly_setup_others)
install(DIRECTORY install(DIRECTORY
${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config ${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config
DESTINATION Gems/Atom/Asset/ImageProcessingAtom DESTINATION Gems/Atom/Asset/ImageProcessingAtom
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Templates # Templates
install(DIRECTORY install(DIRECTORY
${LY_ROOT_FOLDER}/Templates ${LY_ROOT_FOLDER}/Templates
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
# Misc # Misc
@ -535,7 +527,6 @@ function(ly_setup_others)
${LY_ROOT_FOLDER}/LICENSE.txt ${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md ${LY_ROOT_FOLDER}/README.md
DESTINATION . DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endfunction() endfunction()
@ -549,15 +540,12 @@ function(ly_setup_target_generator)
${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp ${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp
${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in ${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in
DESTINATION LauncherGenerator DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform
DESTINATION LauncherGenerator DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake
DESTINATION cmake DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
) )
endfunction() endfunction()

Loading…
Cancel
Save