Integrating latest from github/staging
Integrating up through commit 5e1bdae
This commit is contained in:
+18
-13
@@ -26,12 +26,13 @@ set(LY_PROJECTS "" CACHE STRING "List of projects to enable, this can be a relat
|
||||
# found in the DEPENDENCIES_FILES. The PREFIX and each dependent target will be joined using the <dot> symbol
|
||||
# \arg:TARGETS names of the targets to associate the dependencies to
|
||||
# \arg:DEPENDENCIES_FILES file(s) that contains the load-time dependencies the TARGETS will be associated to
|
||||
# \arg:DEPENDENT_TARGETS additional list of targets should be added as load-time dependencies for the TARGETS list
|
||||
#
|
||||
function(ly_add_target_dependencies)
|
||||
|
||||
set(options)
|
||||
set(oneValueArgs PREFIX)
|
||||
set(multiValueArgs TARGETS DEPENDENCIES_FILES)
|
||||
set(multiValueArgs TARGETS DEPENDENCIES_FILES DEPENDENT_TARGETS)
|
||||
|
||||
cmake_parse_arguments(ly_add_gem_dependencies "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
@@ -40,8 +41,8 @@ function(ly_add_target_dependencies)
|
||||
message(FATAL_ERROR "You must provide at least one target to associate the dependencies with")
|
||||
endif()
|
||||
|
||||
if(NOT ly_add_gem_dependencies_DEPENDENCIES_FILES)
|
||||
message(FATAL_ERROR "DEPENDENCIES_FILES parameter missing")
|
||||
if(NOT ly_add_gem_dependencies_DEPENDENCIES_FILES AND NOT ly_add_gem_dependencies_DEPENDENT_TARGETS)
|
||||
message(FATAL_ERROR "DEPENDENCIES_FILES parameter missing. It must be supplied unless the DEPENDENT_TARGETS parameter is set")
|
||||
endif()
|
||||
|
||||
unset(ALL_GEM_DEPENDENCIES)
|
||||
@@ -52,6 +53,9 @@ function(ly_add_target_dependencies)
|
||||
list(APPEND ALL_GEM_DEPENDENCIES ${GEM_DEPENDENCIES})
|
||||
endforeach()
|
||||
|
||||
# Append the DEPENDENT_TARGETS to the list of ALL_GEM_DEPENDENCIES
|
||||
list(APPEND ALL_GEM_DEPENDENCIES ${ly_add_gem_dependencies_DEPENDENT_TARGETS})
|
||||
|
||||
# for each target, add the dependencies and generate gems json
|
||||
foreach(target ${ly_add_gem_dependencies_TARGETS})
|
||||
ly_add_dependencies(${target} ${ALL_GEM_DEPENDENCIES})
|
||||
@@ -100,15 +104,16 @@ function(ly_add_project_dependencies)
|
||||
endfunction()
|
||||
|
||||
# Add the projects here so the above function is found
|
||||
unset(LY_PROJECTS_NAME)
|
||||
foreach(project ${LY_PROJECTS})
|
||||
if(IS_ABSOLUTE ${project})
|
||||
get_filename_component(project_name ${project} NAME)
|
||||
add_subdirectory(${project} ${project_name})
|
||||
list(APPEND LY_PROJECTS_NAME ${project_name})
|
||||
else()
|
||||
add_subdirectory(${project})
|
||||
list(APPEND LY_PROJECTS_NAME ${project})
|
||||
endif()
|
||||
get_filename_component(full_directory_path ${project} REALPATH ${CMAKE_SOURCE_DIR})
|
||||
string(SHA256 full_directory_hash ${full_directory_path})
|
||||
|
||||
# Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit
|
||||
# when the external subdirectory contains relative paths of significant length
|
||||
string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash)
|
||||
|
||||
get_filename_component(project_folder_name ${project} NAME)
|
||||
list(APPEND LY_PROJECTS_FOLDER_NAME ${project_folder_name})
|
||||
add_subdirectory(${project} "${project_folder_name}-${full_directory_hash}")
|
||||
endforeach()
|
||||
ly_set(LY_PROJECTS_NAME ${LY_PROJECTS_NAME})
|
||||
ly_set(LY_PROJECTS_FOLDER_NAME ${LY_PROJECTS_FOLDER_NAME})
|
||||
|
||||
Reference in New Issue
Block a user