]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - release.cmake
Update cvars in mapdownload.txt
[xonotic/xonotic.git] / release.cmake
index 941282512a7c6655322a26b9a9754e89cb1e3cfe..44b16eb861c0a17f7436ccc7bb04a061e16a76d0 100644 (file)
@@ -7,10 +7,11 @@
 add_custom_target(release)
 
 string(TIMESTAMP stamp "%Y%m%d")
 add_custom_target(release)
 
 string(TIMESTAMP stamp "%Y%m%d")
+string(TIMESTAMP filestamp "%Y-%m-%d")
 
 
-file(STRINGS data/xonotic-data.pk3dir/defaultXonotic.cfg _contents REGEX "^gameversion ")
+file(STRINGS data/xonotic-data.pk3dir/xonotic-common.cfg _contents REGEX "^gameversion ")
 if (NOT _contents)
 if (NOT _contents)
-    message(FATAL_ERROR "defaultXonotic.cfg does not contain gameversion")
+    message(FATAL_ERROR "xonotic-common.cfg does not contain gameversion")
 else ()
     string(REGEX REPLACE ".*gameversion ([0-9]+).*" "\\1" versionstr "${_contents}")
     math(EXPR versionstr_major "${versionstr} / 10000")
 else ()
     string(REGEX REPLACE ".*gameversion ([0-9]+).*" "\\1" versionstr "${_contents}")
     math(EXPR versionstr_major "${versionstr} / 10000")
@@ -66,10 +67,6 @@ if (0)
     getbinary(Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin) # +x
     getbinary(Xonotic/xonotic-osx-dedicated) # +x
 
     getbinary(Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin) # +x
     getbinary(Xonotic/xonotic-osx-dedicated) # +x
 
-    getbinary(Xonotic/xonotic-linux32-sdl) # +x
-    getbinary(Xonotic/xonotic-linux32-glx) # +x
-    getbinary(Xonotic/xonotic-linux32-dedicated) # +x
-
     getbinary(Xonotic/xonotic-linux64-sdl) # +x
     getbinary(Xonotic/xonotic-linux64-glx) # +x
     getbinary(Xonotic/xonotic-linux64-dedicated) # +x
     getbinary(Xonotic/xonotic-linux64-sdl) # +x
     getbinary(Xonotic/xonotic-linux64-glx) # +x
     getbinary(Xonotic/xonotic-linux64-dedicated) # +x
@@ -97,25 +94,26 @@ function(buildpk3 pk3)
     message("registered pk3 ${pk3}")
     set(deps)
     foreach (file IN LISTS files)
     message("registered pk3 ${pk3}")
     set(deps)
     foreach (file IN LISTS files)
-        get_filename_component(rel ${file} DIRECTORY)
-        set(marker "done.data/${pk3}/${file}")
+        set(marker "done.data/${pk3}dir/${file}")
         string(REPLACE "#" "_" marker ${marker})  # OUTPUT cannot contain '#'
         string(REPLACE "#" "_" marker ${marker})  # OUTPUT cannot contain '#'
+        list(APPEND deps "${marker}")
+        get_filename_component(rel ${file} DIRECTORY)
         add_custom_command(OUTPUT ${marker}
         add_custom_command(OUTPUT ${marker}
+                DEPENDS "${dir}/${file}"
                 COMMAND ${CMAKE_COMMAND}
                 "-Dsrc=${PROJECT_SOURCE_DIR}/${dir}/${file}"
                 COMMAND ${CMAKE_COMMAND}
                 "-Dsrc=${PROJECT_SOURCE_DIR}/${dir}/${file}"
-                "-Ddst=data/${pk3}/${rel}"
-                "-Dconv=data/${pk3}/${file}"
+                "-Ddst=data/${pk3}dir/${rel}"
+                "-Dconv=data/${pk3}dir/${file}"
                 -P "transform-${filter}.cmake"
                 VERBATIM)
                 -P "transform-${filter}.cmake"
                 VERBATIM)
-        list(APPEND deps ${marker})
     endforeach ()
     endforeach ()
-    add_custom_target(${pk3} DEPENDS ${deps})
-    add_custom_target(${pk3}-zip DEPENDS ${pk3}.zip)
-    add_dependencies(release ${pk3}-zip)
-    add_custom_command(OUTPUT ${pk3}.zip
-            DEPENDS ${pk3}
-            COMMAND ${CMAKE_COMMAND} -E tar "cfv" "../../${pk3}.zip" --format=zip *
-            WORKING_DIRECTORY "data/${pk3}")
+    add_custom_target(${pk3}dir DEPENDS ${deps})
+    add_custom_target(${pk3}dir-zip DEPENDS ${pk3})
+    add_dependencies(release ${pk3}dir-zip)
+    add_custom_command(OUTPUT ${pk3}
+            DEPENDS ${pk3}dir
+            COMMAND ${CMAKE_COMMAND} -E tar cvf "../../${pk3}" --mtime=${filestamp} --format=zip -- *  # TODO: no wildcard
+            WORKING_DIRECTORY "data/${pk3}dir")
 endfunction()
 
 function(deftransform name)
 endfunction()
 
 function(deftransform name)
@@ -132,6 +130,7 @@ function(deftransform name)
             "        COMMAND ${CMAKE_COMMAND} -E copy \${src} \${conv}\n"
             "        COMMAND ${PROJECT_SOURCE_DIR}/misc/tools/cached-converter.sh \${conv}\n"
             "        COMMAND ${CMAKE_COMMAND} -E make_directory done.\${conv}\n"
             "        COMMAND ${CMAKE_COMMAND} -E copy \${src} \${conv}\n"
             "        COMMAND ${PROJECT_SOURCE_DIR}/misc/tools/cached-converter.sh \${conv}\n"
             "        COMMAND ${CMAKE_COMMAND} -E make_directory done.\${conv}\n"
+            "        COMMAND ${CMAKE_COMMAND} -E touch done.\${conv}\n"
             "        RESULT_VARIABLE res_var\n"
             ")")
 endfunction()
             "        RESULT_VARIABLE res_var\n"
             ")")
 endfunction()
@@ -139,6 +138,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/transform-raw.cmake
         "execute_process(\n"
         "        COMMAND ${CMAKE_COMMAND} -E copy \${src} \${conv}\n"
         "        COMMAND ${CMAKE_COMMAND} -E make_directory done.\${conv}\n"
         "execute_process(\n"
         "        COMMAND ${CMAKE_COMMAND} -E copy \${src} \${conv}\n"
         "        COMMAND ${CMAKE_COMMAND} -E make_directory done.\${conv}\n"
+        "        COMMAND ${CMAKE_COMMAND} -E touch done.\${conv}\n"
         ")")
 
 # default to "del_src\;true"
         ")")
 
 # default to "del_src\;true"