summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/CMakeLists.txt
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-23 20:21:12 +0100
committerMattes D <github@xoft.cz>2014-03-23 20:21:12 +0100
commitb3a22acb2c709839a3787243348d5c1d4884e63a (patch)
tree7c30966a6d00bae79f822cbf4c5ef0a552c22f6c /lib/tolua++/CMakeLists.txt
parentMerge pull request #810 from worktycho/size_t_lua (diff)
parentAdded Additonal check for xxd existance (diff)
downloadcuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar.gz
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar.bz2
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar.lz
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar.xz
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.tar.zst
cuberite-b3a22acb2c709839a3787243348d5c1d4884e63a.zip
Diffstat (limited to 'lib/tolua++/CMakeLists.txt')
-rw-r--r--lib/tolua++/CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt
index 75a301a53..7e7498411 100644
--- a/lib/tolua++/CMakeLists.txt
+++ b/lib/tolua++/CMakeLists.txt
@@ -7,25 +7,28 @@ include_directories ("${PROJECT_SOURCE_DIR}/include/")
include_directories ("${PROJECT_SOURCE_DIR}/../")
include_directories ("${PROJECT_SOURCE_DIR}")
-if(UNIX)
+find_program(XXD_EXECUTABLE xxd)
+
+if(NOT XXD_EXECUTABLE STREQUAL "xxd-NOTFOUND")
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/src/bin/basic_lua.h
- COMMAND xxd -i lua/basic.lua | sed 's/unsigned char/static const unsigned char/g' >basic_lua.h
+ COMMAND ${XXD_EXECUTABLE} -i lua/basic.lua | sed 's/unsigned char/static const unsigned char/g' >basic_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/basic.lua)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/src/bin/enumerate_lua.h
- COMMAND xxd -i lua/enumerate.lua | sed 's/unsigned char/static const unsigned char/g' >enumerate_lua.h
+ COMMAND ${XXD_EXECUTABLE} -i lua/enumerate.lua | sed 's/unsigned char/static const unsigned char/g' >enumerate_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/enumerate.lua)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/src/bin/function_lua.h
- COMMAND xxd -i lua/function.lua | sed 's/unsigned char/static const unsigned char/g' >function_lua.h
+ COMMAND ${XXD_EXECUTABLE} -i lua/function.lua | sed 's/unsigned char/static const unsigned char/g' >function_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/function.lua)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/src/bin/declaration_lua.h
- COMMAND xxd -i lua/declaration.lua | sed 's/unsigned char/static const unsigned char/g' >declaration_lua.h
+ COMMAND ${XXD_EXECUTABLE} -i lua/declaration.lua | sed 's/unsigned char/static const unsigned char/g' >declaration_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/declaration.lua)
set_property(SOURCE src/bin/toluabind.c APPEND PROPERTY OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/enumerate_lua.h ${PROJECT_SOURCE_DIR}/src/bin/basic_lua.h ${PROJECT_SOURCE_DIR}/src/bin/function_lua.h ${PROJECT_SOURCE_DIR}/src/bin/declaration_lua.h)
- message(hello)
+else()
+ message("xxd not found, changes to tolua scripts will be ignored")
endif()