summaryrefslogtreecommitdiffstats
path: root/src/Bindings/CMakeLists.txt
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-07-19 10:15:49 +0200
committerGitHub <noreply@github.com>2016-07-19 10:15:49 +0200
commitc54691a3e578c0c33f0e196959a4c224883b1c93 (patch)
treebb258a4eb246e062e3ad9b3cfa2119411bb1d4ac /src/Bindings/CMakeLists.txt
parentFixes for boat entities (#3265) (diff)
parentCMake: Silenced CMP0054 policy warning. (diff)
downloadcuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.gz
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.bz2
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.lz
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.xz
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.zst
cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.zip
Diffstat (limited to 'src/Bindings/CMakeLists.txt')
-rw-r--r--src/Bindings/CMakeLists.txt28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt
index 5c79225cc..23ba4c7e6 100644
--- a/src/Bindings/CMakeLists.txt
+++ b/src/Bindings/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required (VERSION 2.6)
project (Cuberite)
include_directories ("${PROJECT_SOURCE_DIR}/../")
@@ -56,7 +55,6 @@ set (BINDING_OUTPUTS
)
set(BINDING_DEPENDENCIES
- tolua
../Bindings/AllToLua.pkg
../Bindings/BindingsProcessor.lua
../Bindings/LuaFunctions.h
@@ -139,17 +137,21 @@ set(BINDING_DEPENDENCIES
)
if (NOT MSVC)
- ADD_CUSTOM_COMMAND(
- # add any new generated bindings here
- OUTPUT ${BINDING_OUTPUTS}
-
- # Regenerate bindings:
- COMMAND tolua -L BindingsProcessor.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-
- # add any new generation dependencies here
- DEPENDS ${BINDING_DEPENDENCIES}
- )
+ if (HAS_LUA_INTERPRETER)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${BINDING_OUTPUTS}
+ COMMAND lua BindingsProcessor.lua
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${BINDING_DEPENDENCIES}
+ )
+ else()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${BINDING_OUTPUTS}
+ COMMAND tolua -L BindingsProcessor.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${BINDING_DEPENDENCIES} tolua
+ )
+ endif()
endif ()
set_source_files_properties(${BINDING_OUTPUTS} PROPERTIES GENERATED TRUE)