Commits

mcc committed 6090300

Fix initial build following removal of Lua build products from scm

  • Participants
  • Parent commits ac8436e

Comments (0)

Files changed (5)

File Bindings/Contents/LUA/CMakeLists.txt

 )
 
 SET(polycodeLua_SRCS
-    Source/PolycodeLUA.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/Source/PolycodeLUA.cpp
 )
 
 SET(polycodeLua_HDRS
-    Include/PolycodeLUAWrappers.h
-    Include/PolycodeLUA.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/PolycodeLUAWrappers.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/PolycodeLUA.h
 )
 
 SET(CMAKE_DEBUG_POSTFIX "_d")
 #    TARGET_LINK_LIBRARIES(PolycodeLua Polycore ${LUA_LIBRARY})
 #ENDIF(POLYCODE_BUILD_SHARED)
 
-#IF(POLYCODE_BUILD_STATIC)
+#IF(POLYCODE_BUILD_STATIC) 
 ADD_LIBRARY(PolycodeLua ${polycodeLua_SRCS} ${polycodeLua_HDRS})
+
+SET_SOURCE_FILES_PROPERTIES(Source/PolycodeLUA.cpp PROPERTIES GENERATED 1) 
+SET_SOURCE_FILES_PROPERTIES(Include/PolycodeLUAWrappers.h PROPERTIES GENERATED 1)
+SET_SOURCE_FILES_PROPERTIES(Include/PolycodeLUA.h PROPERTIES GENERATED 1) 
 ADD_DEPENDENCIES(PolycodeLua PolycodeLuaGenerate)
 #ENDIF(POLYCODE_BUILD_STATIC)
 

File Bindings/Scripts/create_lua_library/create_lua_library.py

 import sys
 import CppHeaderParser
 import os
+import errno
 import re
 
+def mkdir_p(path): # Same effect as mkdir -p, create dir and all necessary parent dirs
+    try:
+        os.makedirs(path)
+    except OSError as e:
+        if e.errno == errno.EEXIST: # Dir already exists; not really an error
+            pass
+        else: raise
+
 def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, apiPath, apiClassPath, includePath, sourcePath, inheritInModuleFiles):	
 	out = ""
 	sout = ""
 					#lout += "\tself:handleEvent(event)\n"
 					lout += "end\n"
 				lfout += "require \"%s/%s\"\n" % (prefix, ckey)
+				mkdir_p(apiClassPath)
 				fout = open("%s/%s.lua" % (apiClassPath, ckey), "w")
 				fout.write(lout)
 		except CppHeaderParser.CppParseError,  e:
 	shout += "int _PolyExport luaopen_%s(lua_State *L);\n" % (prefix)
 	shout += "}\n"
 	
+	mkdir_p(includePath)
+	mkdir_p(apiPath)
+	mkdir_p(sourcePath)
+
 	fout = open("%s/%sLUA.h" % (includePath, prefix), "w")
 	fout.write(shout)
 

File Modules/Bindings/2DPhysics/CMakeLists.txt

 )
 
 SET(polycode2DPhysics_SRCS
-    Source/Physics2DLUA.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/Source/Physics2DLUA.cpp
     ../../Contents/2DPhysics/Source/PolyPhysicsScreen.cpp
     ../../Contents/2DPhysics/Source/PolyPhysicsScreenEntity.cpp
 )
 
 SET(polycode2DPhysics_HDRS
-    Include/Physics2DLUA.h
-    Include/Physics2DLUAWrappers.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/Physics2DLUA.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/Physics2DLUAWrappers.h
     ../../Contents/2DPhysics/Include/Polycode2DPhysics.h
     ../../Contents/2DPhysics/Include/PolyPhysicsScreenEntity.h
-   ../../Contents/2DPhysics/Include/PolyPhysicsScreen.h
+    ../../Contents/2DPhysics/Include/PolyPhysicsScreen.h
 )
 
 ADD_LIBRARY(Physics2D SHARED ${polycode2DPhysics_SRCS} ${polycode2DPhysics_HDRS})
+
+SET_SOURCE_FILES_PROPERTIES(Source/Physics2DLUA.cpp PROPERTIES GENERATED 1)
+SET_SOURCE_FILES_PROPERTIES(Include/Physics2DLUAWrappers.h PROPERTIES GENERATED 1)
+SET_SOURCE_FILES_PROPERTIES(Include/Physics2DLUA.h PROPERTIES GENERATED 1)
+ADD_DEPENDENCIES(Physics2D PolycodeLuaGenerate)
+
 SET(CMAKE_DEBUG_POSTFIX "_d")
 
 SET_TARGET_PROPERTIES(Physics2D PROPERTIES PREFIX "")

File Modules/Bindings/3DPhysics/CMakeLists.txt

 )
 
 SET(polycode3DPhysics_SRCS
-    Source/Physics3DLUA.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/Source/Physics3DLUA.cpp
     ../../Contents/3DPhysics/Source/PolyPhysicsSceneEntity.cpp
     ../../Contents/3DPhysics/Source/PolyPhysicsScene.cpp
     ../../Contents/3DPhysics/Source/PolyCollisionSceneEntity.cpp
 )
 
 SET(polycode3DPhysics_HDRS
-    Include/Physics3DLUA.h
-    Include/Physics3DLUAWrappers.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/Physics3DLUA.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/Include/Physics3DLUAWrappers.h
     ../../Contents/3DPhysics/Include/PolyPhysicsSceneEntity.h
     ../../Contents/3DPhysics/Include/Polycode3DPhysics.h
     ../../Contents/3DPhysics/Include/PolyCollisionScene.h
 
 ADD_LIBRARY(Physics3D SHARED ${polycode3DPhysics_SRCS} ${polycode3DPhysics_HDRS})
 
+SET_SOURCE_FILES_PROPERTIES(Source/Physics3DLUA.cpp PROPERTIES GENERATED 1)
+SET_SOURCE_FILES_PROPERTIES(Include/Physics3DLUAWrappers.h PROPERTIES GENERATED 1)
+SET_SOURCE_FILES_PROPERTIES(Include/Physics3DLUA.h PROPERTIES GENERATED 1)
+ADD_DEPENDENCIES(Physics2D PolycodeLuaGenerate)
+
 SET(CMAKE_DEBUG_POSTFIX "_d")
 
 SET_TARGET_PROPERTIES(Physics3D PROPERTIES PREFIX "")

File Modules/Contents/2DPhysics/Include/PolyPhysicsScreen.h

 	void init(Number worldScale, Number physicsTimeStep, int physicsIterations, Vector2 physicsGravity);
 
 	std::vector <PhysicsScreenEntity*> physicsChildren;
+	std::vector<b2Contact*> contacts;
 	b2World *world;
 	Number timeStep;
 	int32 iterations;