|
@@ -12,6 +12,13 @@ include_guard()
|
|
# Subdirectory processing
|
|
# Subdirectory processing
|
|
################################################################################
|
|
################################################################################
|
|
|
|
|
|
|
|
+# Add a GLOBAL property which can be used to quickly determine if a directory is an external subdirectory
|
|
|
|
+get_property(cache_external_subdirs CACHE LY_EXTERNAL_SUBDIRS PROPERTY VALUE)
|
|
|
|
+foreach(cache_external_subdir IN LISTS cache_external_subdirs)
|
|
|
|
+ file(REAL_PATH ${cache_external_subdir} real_external_subdir)
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
|
|
+endforeach()
|
|
|
|
+
|
|
# The following functions is for gathering the list of external subdirectories
|
|
# The following functions is for gathering the list of external subdirectories
|
|
# provided by the engine.json
|
|
# provided by the engine.json
|
|
function(add_engine_gem_json_external_subdirectories gem_path)
|
|
function(add_engine_gem_json_external_subdirectories gem_path)
|
|
@@ -31,6 +38,7 @@ function(add_engine_gem_json_external_subdirectories gem_path)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_engine_gem_json_external_subdirectories(${real_external_subdir})
|
|
add_engine_gem_json_external_subdirectories(${real_external_subdir})
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -41,13 +49,14 @@ function(add_engine_json_external_subdirectories)
|
|
set(engine_json_path ${LY_ROOT_FOLDER}/engine.json)
|
|
set(engine_json_path ${LY_ROOT_FOLDER}/engine.json)
|
|
if(EXISTS ${engine_json_path})
|
|
if(EXISTS ${engine_json_path})
|
|
o3de_read_json_external_subdirs(engine_external_subdirs ${engine_json_path})
|
|
o3de_read_json_external_subdirs(engine_external_subdirs ${engine_json_path})
|
|
- foreach(engine_external_subdir IN LISTS engine_external_subdirs )
|
|
|
|
|
|
+ foreach(engine_external_subdir IN LISTS engine_external_subdirs)
|
|
file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER})
|
|
file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER})
|
|
|
|
|
|
# Append external subdirectory ONLY to LY_EXTERNAL_SUBDIRS_ENGINE PROPERTY
|
|
# Append external subdirectory ONLY to LY_EXTERNAL_SUBDIRS_ENGINE PROPERTY
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_engine_gem_json_external_subdirectories(${real_external_subdir})
|
|
add_engine_gem_json_external_subdirectories(${real_external_subdir})
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -74,6 +83,7 @@ function(add_project_gem_json_external_subdirectories gem_path project_name)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_${project_name})
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_${project_name})
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}")
|
|
add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}")
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -91,6 +101,7 @@ function(add_project_json_external_subdirectories project_path project_name)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_${project_name})
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_${project_name})
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}")
|
|
add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}")
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -117,6 +128,7 @@ function(add_o3de_manifest_gem_json_external_subdirectories gem_path)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir})
|
|
add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir})
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -136,6 +148,7 @@ function(add_o3de_manifest_json_external_subdirectories)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST)
|
|
get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
if(NOT real_external_subdir IN_LIST current_external_subdirs)
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir})
|
|
set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir})
|
|
|
|
+ set_property(GLOBAL PROPERTY "O3DE_SUBDIRECTORY_${real_external_subdir}" TRUE)
|
|
add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir})
|
|
add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir})
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
@@ -291,8 +304,8 @@ endfunction()
|
|
#! or references("gem_names")
|
|
#! or references("gem_names")
|
|
function(get_external_subdirectories_in_use output_subdirs)
|
|
function(get_external_subdirectories_in_use output_subdirs)
|
|
# Gather the list of external subdirectories set through the LY_EXTERNAL_SUBDIRS Cache Variable
|
|
# Gather the list of external subdirectories set through the LY_EXTERNAL_SUBDIRS Cache Variable
|
|
- get_property(all_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS)
|
|
|
|
- # Append the list of Extenal Subdirectories from the engine.json
|
|
|
|
|
|
+ get_property(all_external_subdirs CACHE LY_EXTERNAL_SUBDIRS PROPERTY VALUE)
|
|
|
|
+ # Append the list of external subdirectories from the engine.json
|
|
get_property(engine_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
get_property(engine_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE)
|
|
list(APPEND all_external_subdirs ${engine_external_subdirs})
|
|
list(APPEND all_external_subdirs ${engine_external_subdirs})
|
|
# Append the gems referenced by name from "gem_names" field in the engine.json
|
|
# Append the gems referenced by name from "gem_names" field in the engine.json
|