aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/scripts/common/Macros.cmake18
2 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6ba1e9097..0ef3151592 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -509,6 +509,8 @@ add_custom_target(gen_skin_pack DEPENDS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${
add_custom_target(generate-packaging ALL
DEPENDS TexturePacker::TexturePacker::Executable export-files gen_skin_pack gen_system_addons)
+core_target_add_dependencies(export-files)
+
# Add to lib${APP_NAME_LC} solely for Win UWP. msix building doesnt seem to pick up the
# generated buildtree if we do it later. Other platforms dont care when this happens.
add_dependencies(lib${APP_NAME_LC} generate-packaging)
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake
index e3ae5ed9b1..987301cb22 100644
--- a/cmake/scripts/common/Macros.cmake
+++ b/cmake/scripts/common/Macros.cmake
@@ -797,3 +797,21 @@ function(core_target_link_libraries core_lib)
endif()
endforeach()
endfunction()
+
+# Iterate over optional/required dep lists and create dependency
+# to the target supplied as first argument
+function(core_target_add_dependencies core_target)
+ foreach(_depspec ${required_deps})
+ split_dependency_specification(${_depspec} dep version)
+ if(TARGET ${APP_NAME_LC}::${dep})
+ add_dependencies(${core_target} ${APP_NAME_LC}::${dep})
+ endif()
+ endforeach()
+
+ foreach(_depspec ${optional_deps})
+ split_dependency_specification(${_depspec} dep version)
+ if(TARGET ${APP_NAME_LC}::${dep})
+ add_dependencies(${core_target} ${APP_NAME_LC}::${dep})
+ endif()
+ endforeach()
+endfunction()