Explorar o código

Added copying of the config file to the bin folder

Karim Ahmed %!s(int64=13) %!d(string=hai) anos
pai
achega
4099ae8d65
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      gameplay-template/gameplay-template-CMakeLists.txt

+ 5 - 4
gameplay-template/gameplay-template-CMakeLists.txt

@@ -31,11 +31,11 @@ macro (append_gameplay_ext_lib listToAppend libName libDirName)
     message(STATUS "Library Found: ${libName} Path: ${FOUND_LIB_${libName}}")
 endmacro (append_gameplay_ext_lib)
 
-macro(copy_files GLOBPAT SOURCE DESTINATION)
+macro(copy_files TARGET_NAME GLOBPAT SOURCE DESTINATION)
   file(GLOB COPY_FILES
     RELATIVE ${SOURCE}
     "${SOURCE}/${GLOBPAT}")
-  add_custom_target(copy ALL
+  add_custom_target(${TARGET_NAME} ALL
     COMMENT "Copying files: ${SOURCE}/${GLOBPAT}")
 
   foreach(FILENAME ${COPY_FILES})
@@ -43,7 +43,7 @@ macro(copy_files GLOBPAT SOURCE DESTINATION)
     set(DST "${DESTINATION}/${FILENAME}")
 
     add_custom_command(
-      TARGET copy
+      TARGET ${TARGET_NAME}
       COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SRC} ${DST}
       )
   endforeach(FILENAME)
@@ -103,4 +103,5 @@ set_target_properties(${GAME_NAME} PROPERTIES
 #TODO: Copy res files to the bin dir, it is done that way so we can make post
 #processing to the the res files in the future like zipping or preparation to
 #per platfom format.
-copy_files(* "${CMAKE_SOURCE_DIR}/res" "${GAME_OUTPUT_DIR}/res")
+copy_files(CopyRes * "${CMAKE_SOURCE_DIR}/res" "${GAME_OUTPUT_DIR}/res")
+copy_files(CopyConfig *.config "${CMAKE_SOURCE_DIR}" "${GAME_OUTPUT_DIR}")