# HG changeset patch
# User sheepluva
# Date 1386088747 -3600
# Node ID cf086f49516b72dafc6638eaaab7cb88fb86d862
# Parent  d159ddae03584415a8f90a658b72f7064cee368f
make source files objects depend on their predecessors in list

diff -r d159ddae0358 -r cf086f49516b hedgewars/CMakeLists.txt
--- a/hedgewars/CMakeLists.txt	Tue Dec 03 17:06:40 2013 +0200
+++ b/hedgewars/CMakeLists.txt	Tue Dec 03 17:39:07 2013 +0100
@@ -166,6 +166,16 @@
 #needs to be last
 add_definitions(-dDEBUGFILE)
 
+
+# make source files objects depend on their predecessors in list
+foreach(loop_var ${engine_sources})
+    if (sourcefiles_sofar)
+        SET_SOURCE_FILES_PROPERTIES(${loop_var} PROPERTIES OBJECT_DEPENDS "${sourcefiles_sofar}")
+    endif()
+    list(APPEND sourcefiles_sofar "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
+endforeach(loop_var)
+
+
 #SOURCE AND PROGRAMS SECTION
 if(BUILD_ENGINE_LIBRARY)
     message("***Engine will be built as library (experimental)***")