summaryrefslogtreecommitdiffstats
path: root/src/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/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/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 76a18801d..13bf6e379 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required (VERSION 2.8.2)
project (Cuberite)
@@ -252,6 +251,10 @@ else ()
foreach (hdr ${FOLDER_HDRS})
list(APPEND SOURCE "${folder}/${hdr}")
endforeach(hdr)
+
+ # Include this folder's CMakeLists.txt in the project:
+ list(APPEND SOURCE "${folder}/CMakeLists.txt")
+ source_group("${folder}" FILES "${folder}/CMakeLists.txt")
endforeach(folder)
list(APPEND SOURCE "${SRCS}")
@@ -315,19 +318,26 @@ if (MSVC)
list (APPEND BINDINGS_DEPENDENCIES "Bindings/${dep}")
endforeach(dep)
- 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}/Server/lua51.dll ./lua51.dll
+ if (HAS_LUA_INTERPRETER)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${BINDING_OUTPUTS}
+ COMMAND lua BindingsProcessor.lua
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+ DEPENDS ${BINDINGS_DEPENDENCIES}
+ )
+ else()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${BINDING_OUTPUTS}
- # Regenerate bindings:
- COMMAND tolua -L BindingsProcessor.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+ # 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}/Server/lua51.dll ./lua51.dll
- # add any new generation dependencies here
- DEPENDS ${BINDINGS_DEPENDENCIES}
- )
+ # Regenerate bindings:
+ COMMAND tolua -L BindingsProcessor.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
+ DEPENDS ${BINDINGS_DEPENDENCIES} tolua
+ )
+ endif()
endif()
add_executable(${EXECUTABLE} ${SOURCE})
@@ -378,3 +388,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
endif()
target_link_libraries(${EXECUTABLE} luaexpat jsoncpp_lib_static mbedtls zlib sqlite lua SQLiteCpp event_core event_extra)
+
+# Create a folder for Bindings' documentation:
+FILE(MAKE_DIRECTORY "Bindings/docs")