summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-19 04:25:15 +0200
committerarchshift <admin@archshift.com>2014-07-19 04:53:47 +0200
commit0960e6ae8ffe329ecd78b2f0f433fcb9e817a696 (patch)
tree9f884f685f1ac21deda656ac175376ff2ede5e8c /src/CMakeLists.txt
parentCMakeLists: Moved Bindings-specific code to subdir (diff)
downloadcuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar.gz
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar.bz2
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar.lz
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar.xz
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.tar.zst
cuberite-0960e6ae8ffe329ecd78b2f0f433fcb9e817a696.zip
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6008d3174..168c576e2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -230,6 +230,25 @@ endif()
set(EXECUTABLE MCServer)
+if (WIN32)
+ get_directory_property(BINDING_OUTPUTS DIRECTORY "Bindings" DEFINITION BINDING_OUTPUTS)
+ get_directory_property(BINDING_DEPENDENCIES DIRECTORY "Bindings" DEFINITION BINDING_DEPENDENCIES)
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${BINDING_OUTPUTS}
+
+ # Copy the Lua DLL into the Bindings folder, so that tolua can run from there:
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/MCServer/lua51.dll ./lua51.dll
+
+ # Regenerate bindings:
+ COMMAND tolua -L Bindings/virtual_method_hooks.lua -o Bindings/Bindings.cpp -H Bindings/Bindings.h Bindings/AllToLua.pkg
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+
+ # add any new generation dependencies here
+ DEPENDS ${BINDING_DEPENDECIES}
+ )
+endif()
+
add_executable(${EXECUTABLE} ${SOURCE})