aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt20
-rw-r--r--cmake/scripts/common/ProjectMacros.cmake3
2 files changed, 18 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e137c447c..defd8e7769 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -412,6 +412,7 @@ else()
endif()
# These are skins that are copied into place from the source tree
+set(XBT_SOURCE_FILELIST "")
foreach(skin ${SKINS})
list(GET skin 0 dir)
list(GET skin 1 relative)
@@ -430,11 +431,20 @@ add_custom_target(gen_system_addons
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# Pack skins and copy to correct build dir (MultiConfig Generator aware)
-add_custom_target(gen_skin_pack
- COMMAND ${CMAKE_COMMAND} -DBUNDLEDIR=${_bundle_dir}
- -DTEXTUREPACKER_EXECUTABLE=$<TARGET_FILE:TexturePacker::TexturePacker::Executable>
- -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/GeneratedPackSkins.cmake
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/$<CONFIG>/gen_skin.timestamp
+ COMMAND ${CMAKE_COMMAND} -DBUNDLEDIR=${_bundle_dir}
+ -DTEXTUREPACKER_EXECUTABLE=$<TARGET_FILE:TexturePacker::TexturePacker::Executable>
+ -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/GeneratedPackSkins.cmake
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/$<CONFIG>
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/$<CONFIG>/gen_skin.timestamp
+ DEPENDS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/GeneratedPackSkins.cmake
+ ${XBT_SOURCE_FILELIST}
+ BYPRODUCTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/$<CONFIG>/gen_skin.timestamp
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ COMMENT "Generating skin xbt"
+)
+add_custom_target(gen_skin_pack DEPENDS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/$<CONFIG>/gen_skin.timestamp)
# Packaging target. This generates system addon, xbt creation, copy files to build tree
add_custom_target(generate-packaging ALL
diff --git a/cmake/scripts/common/ProjectMacros.cmake b/cmake/scripts/common/ProjectMacros.cmake
index 015cc3db94..e3d9a58a6d 100644
--- a/cmake/scripts/common/ProjectMacros.cmake
+++ b/cmake/scripts/common/ProjectMacros.cmake
@@ -8,6 +8,8 @@
# xbt is added to ${XBT_FILES}
function(pack_xbt input output)
file(GLOB_RECURSE MEDIA_FILES ${input}/*)
+ list(APPEND XBT_SOURCE_FILELIST ${MEDIA_FILES})
+ set(XBT_SOURCE_FILELIST ${XBT_SOURCE_FILELIST} PARENT_SCOPE)
get_filename_component(dir ${output} DIRECTORY)
if(${CORE_SYSTEM_NAME} MATCHES "windows")
@@ -45,6 +47,7 @@ function(copy_skin_to_buildtree skin)
endforeach()
set(XBT_FILES ${XBT_FILES} PARENT_SCOPE)
+ set(XBT_SOURCE_FILELIST ${XBT_SOURCE_FILELIST} PARENT_SCOPE)
set(install_data ${install_data} PARENT_SCOPE)
endfunction()