diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 935f32ea1..8218588e4 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.26.0 FATAL_ERROR) set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE) @@ -607,22 +607,22 @@ endif() ################################################################################ # Pre build events ################################################################################ -if (MSVC) - set(MSVC_CMD ${CMAKE_COMMAND} -E copy_directory $/assets ${CMAKE_BINARY_DIR}/soh/assets) +if (CMAKE_GENERATOR MATCHES "Visual Studio") + set(VS_COPY_ASSETS_CMD ${CMAKE_COMMAND} -E copy_directory_if_different $/assets ${CMAKE_BINARY_DIR}/soh/assets) endif() if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS") add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMENT "Copying asset xmls..." - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/soh/assets/extractor $/assets/extractor - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/soh/assets/xml $/assets/extractor/xmls - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists $/assets/extractor/filelists + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/extractor $/assets/extractor + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/xml $/assets/extractor/xmls + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists $/assets/extractor/filelists COMMAND ${CMAKE_COMMAND} -E make_directory $/assets/extractor/symbols - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt $/assets/extractor/symbols - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt $/assets/extractor/symbols - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt $/assets/extractor/symbols - COMMAND ${MSVC_CMD} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt $/assets/extractor/symbols + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt $/assets/extractor/symbols + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt $/assets/extractor/symbols + COMMAND ${VS_COPY_ASSETS_CMD} ) endif() ################################################################################