CMakeLists: Moved Bindings-specific code to subdir
This commit is contained in:
parent
3d368b015e
commit
135dc333c1
|
@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.6)
|
||||||
project (MCServer)
|
project (MCServer)
|
||||||
|
|
||||||
include_directories ("${PROJECT_SOURCE_DIR}/../")
|
include_directories ("${PROJECT_SOURCE_DIR}/../")
|
||||||
|
include_directories (".")
|
||||||
|
|
||||||
SET (SRCS
|
SET (SRCS
|
||||||
Bindings.cpp
|
Bindings.cpp
|
||||||
|
@ -31,6 +32,116 @@ SET (HDRS
|
||||||
tolua++.h
|
tolua++.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# List all the files that are generated as part of the Bindings build process
|
||||||
|
set (BINDING_OUTPUTS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/Bindings.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/Bindings.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/LuaState_Call.inc
|
||||||
|
)
|
||||||
|
|
||||||
|
set(BINDING_DEPENDECIES
|
||||||
|
tolua
|
||||||
|
../Bindings/virtual_method_hooks.lua
|
||||||
|
../Bindings/AllToLua.pkg
|
||||||
|
../Bindings/gen_LuaState_Call.lua
|
||||||
|
../Bindings/LuaFunctions.h
|
||||||
|
../Bindings/LuaState_Call.inc
|
||||||
|
../Bindings/LuaWindow.h
|
||||||
|
../Bindings/Plugin.h
|
||||||
|
../Bindings/PluginLua.h
|
||||||
|
../Bindings/PluginManager.h
|
||||||
|
../Bindings/WebPlugin.h
|
||||||
|
../BiomeDef.h
|
||||||
|
../BlockArea.h
|
||||||
|
../BlockEntities/BlockEntity.h
|
||||||
|
../BlockEntities/BlockEntityWithItems.h
|
||||||
|
../BlockEntities/ChestEntity.h
|
||||||
|
../BlockEntities/DispenserEntity.h
|
||||||
|
../BlockEntities/DropSpenserEntity.h
|
||||||
|
../BlockEntities/DropperEntity.h
|
||||||
|
../BlockEntities/FurnaceEntity.h
|
||||||
|
../BlockEntities/HopperEntity.h
|
||||||
|
../BlockEntities/JukeboxEntity.h
|
||||||
|
../BlockEntities/NoteEntity.h
|
||||||
|
../BlockEntities/SignEntity.h
|
||||||
|
../BlockEntities/MobHeadEntity.h
|
||||||
|
../BlockEntities/FlowerPotEntity.h
|
||||||
|
../BlockID.h
|
||||||
|
../BoundingBox.h
|
||||||
|
../ChatColor.h
|
||||||
|
../ChunkDef.h
|
||||||
|
../ClientHandle.h
|
||||||
|
../CraftingRecipes.h
|
||||||
|
../Cuboid.h
|
||||||
|
../Defines.h
|
||||||
|
../Enchantments.h
|
||||||
|
../Entities/EntityEffect.h
|
||||||
|
../Entities/Entity.h
|
||||||
|
../Entities/Floater.h
|
||||||
|
../Entities/Pawn.h
|
||||||
|
../Entities/Painting.h
|
||||||
|
../Entities/Pickup.h
|
||||||
|
../Entities/Player.h
|
||||||
|
../Entities/ProjectileEntity.h
|
||||||
|
../Entities/ArrowEntity.h
|
||||||
|
../Entities/ThrownEggEntity.h
|
||||||
|
../Entities/ThrownEnderPearlEntity.h
|
||||||
|
../Entities/ExpBottleEntity.h
|
||||||
|
../Entities/ThrownSnowballEntity.h
|
||||||
|
../Entities/FireChargeEntity.h
|
||||||
|
../Entities/FireworkEntity.h
|
||||||
|
../Entities/GhastFireballEntity.h
|
||||||
|
../Entities/TNTEntity.h
|
||||||
|
../Entities/ExpOrb.h
|
||||||
|
../Entities/HangingEntity.h
|
||||||
|
../Entities/ItemFrame.h
|
||||||
|
../Generating/ChunkDesc.h
|
||||||
|
../Group.h
|
||||||
|
../Inventory.h
|
||||||
|
../Item.h
|
||||||
|
../ItemGrid.h
|
||||||
|
../Mobs/Monster.h
|
||||||
|
../OSSupport/File.h
|
||||||
|
../Root.h
|
||||||
|
../Server.h
|
||||||
|
../StringUtils.h
|
||||||
|
../Tracer.h
|
||||||
|
../UI/Window.h
|
||||||
|
../Vector3.h
|
||||||
|
../WebAdmin.h
|
||||||
|
../World.h
|
||||||
|
)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
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 ../../MCServer/lua51.dll ./lua51.dll
|
||||||
|
|
||||||
|
# Regenerate bindings:
|
||||||
|
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
|
||||||
|
# add any new generation dependencies here
|
||||||
|
DEPENDS ${BINDING_DEPENDECIES}
|
||||||
|
)
|
||||||
|
else ()
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
# add any new generated bindings here
|
||||||
|
OUTPUT ${BINDING_OUTPUTS}
|
||||||
|
|
||||||
|
# Regenerate bindings:
|
||||||
|
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
|
||||||
|
# add any new generation dependencies here
|
||||||
|
DEPENDS ${BINDING_DEPENDECIES}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE)
|
||||||
|
set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_library(Bindings ${SRCS} ${HDRS})
|
add_library(Bindings ${SRCS} ${HDRS})
|
||||||
|
|
||||||
|
|
|
@ -10,78 +10,6 @@ set(FOLDERS
|
||||||
WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs
|
WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs
|
||||||
)
|
)
|
||||||
|
|
||||||
set(BINDING_DEPENDECIES
|
|
||||||
tolua
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/virtual_method_hooks.lua
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/AllToLua.pkg
|
|
||||||
Bindings/gen_LuaState_Call.lua
|
|
||||||
Bindings/LuaFunctions.h
|
|
||||||
Bindings/LuaWindow.h
|
|
||||||
Bindings/Plugin.h
|
|
||||||
Bindings/PluginLua.h
|
|
||||||
Bindings/PluginManager.h
|
|
||||||
Bindings/WebPlugin.h
|
|
||||||
BiomeDef.h
|
|
||||||
BlockArea.h
|
|
||||||
BlockEntities/BlockEntity.h
|
|
||||||
BlockEntities/BlockEntityWithItems.h
|
|
||||||
BlockEntities/ChestEntity.h
|
|
||||||
BlockEntities/DispenserEntity.h
|
|
||||||
BlockEntities/DropSpenserEntity.h
|
|
||||||
BlockEntities/DropperEntity.h
|
|
||||||
BlockEntities/FurnaceEntity.h
|
|
||||||
BlockEntities/HopperEntity.h
|
|
||||||
BlockEntities/JukeboxEntity.h
|
|
||||||
BlockEntities/NoteEntity.h
|
|
||||||
BlockEntities/SignEntity.h
|
|
||||||
BlockEntities/MobHeadEntity.h
|
|
||||||
BlockEntities/FlowerPotEntity.h
|
|
||||||
BlockID.h
|
|
||||||
BoundingBox.h
|
|
||||||
ChatColor.h
|
|
||||||
ChunkDef.h
|
|
||||||
ClientHandle.h
|
|
||||||
CraftingRecipes.h
|
|
||||||
Cuboid.h
|
|
||||||
Defines.h
|
|
||||||
Enchantments.h
|
|
||||||
Entities/EntityEffect.h
|
|
||||||
Entities/Entity.h
|
|
||||||
Entities/Floater.h
|
|
||||||
Entities/Pawn.h
|
|
||||||
Entities/Painting.h
|
|
||||||
Entities/Pickup.h
|
|
||||||
Entities/Player.h
|
|
||||||
Entities/ProjectileEntity.h
|
|
||||||
Entities/ArrowEntity.h
|
|
||||||
Entities/ThrownEggEntity.h
|
|
||||||
Entities/ThrownEnderPearlEntity.h
|
|
||||||
Entities/ExpBottleEntity.h
|
|
||||||
Entities/ThrownSnowballEntity.h
|
|
||||||
Entities/FireChargeEntity.h
|
|
||||||
Entities/FireworkEntity.h
|
|
||||||
Entities/GhastFireballEntity.h
|
|
||||||
Entities/TNTEntity.h
|
|
||||||
Entities/ExpOrb.h
|
|
||||||
Entities/HangingEntity.h
|
|
||||||
Entities/ItemFrame.h
|
|
||||||
Generating/ChunkDesc.h
|
|
||||||
Group.h
|
|
||||||
Inventory.h
|
|
||||||
Item.h
|
|
||||||
ItemGrid.h
|
|
||||||
Mobs/Monster.h
|
|
||||||
OSSupport/File.h
|
|
||||||
Root.h
|
|
||||||
Server.h
|
|
||||||
StringUtils.h
|
|
||||||
Tracer.h
|
|
||||||
UI/Window.h
|
|
||||||
Vector3.h
|
|
||||||
WebAdmin.h
|
|
||||||
World.h
|
|
||||||
)
|
|
||||||
|
|
||||||
SET (SRCS
|
SET (SRCS
|
||||||
BiomeDef.cpp
|
BiomeDef.cpp
|
||||||
BlockArea.cpp
|
BlockArea.cpp
|
||||||
|
@ -207,51 +135,19 @@ SET (HDRS
|
||||||
World.h
|
World.h
|
||||||
XMLParser.h)
|
XMLParser.h)
|
||||||
|
|
||||||
# List all the files that are generated as part of the Bindings build process
|
include_directories(".")
|
||||||
set (BINDING_OUTPUTS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/LuaState_Call.inc
|
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(Bindings)
|
|
||||||
include_directories(.)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
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 ../../MCServer/lua51.dll ./lua51.dll
|
|
||||||
|
|
||||||
# Regenerate bindings:
|
|
||||||
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
|
|
||||||
|
|
||||||
# add any new generation dependencies here
|
|
||||||
DEPENDS ${BINDING_DEPENDECIES}
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
# add any new generated bindings here
|
|
||||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
|
|
||||||
|
|
||||||
# Regenerate bindings:
|
|
||||||
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
|
|
||||||
|
|
||||||
# add any new generation dependencies here
|
|
||||||
DEPENDS ${BINDING_DEPENDECIES}
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE)
|
|
||||||
set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
|
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
# Bindings need to reference other folders, so they are done here instead
|
# Bindings need to reference other folders, so they are done here instead
|
||||||
# lib dependencies are not included
|
# lib dependencies are not included
|
||||||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
||||||
|
|
||||||
|
foreach(folder ${FOLDERS})
|
||||||
|
add_subdirectory(${folder})
|
||||||
|
endforeach(folder)
|
||||||
|
|
||||||
|
get_directory_property(BINDING_DEPENDENCIES DIRECTORY "Bindings" DEFINITION BINDING_DEPENDENCIES)
|
||||||
|
|
||||||
#clear file
|
#clear file
|
||||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/BindingDependecies.txt)
|
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/BindingDependecies.txt)
|
||||||
foreach(dependecy ${BINDING_DEPENDECIES})
|
foreach(dependecy ${BINDING_DEPENDECIES})
|
||||||
|
@ -261,10 +157,6 @@ if (NOT MSVC)
|
||||||
|
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Bindings.cpp Bindings.h")
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Bindings.cpp Bindings.h")
|
||||||
|
|
||||||
foreach(folder ${FOLDERS})
|
|
||||||
add_subdirectory(${folder})
|
|
||||||
endforeach(folder)
|
|
||||||
|
|
||||||
list(APPEND SOURCE "${SRCS}")
|
list(APPEND SOURCE "${SRCS}")
|
||||||
list(APPEND SOURCE "${HDRS}")
|
list(APPEND SOURCE "${HDRS}")
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ project (MCServer)
|
||||||
|
|
||||||
include_directories ("${PROJECT_SOURCE_DIR}/../")
|
include_directories ("${PROJECT_SOURCE_DIR}/../")
|
||||||
|
|
||||||
set(SOURCES
|
set(SRCS
|
||||||
AesCfb128Decryptor.cpp
|
AesCfb128Decryptor.cpp
|
||||||
AesCfb128Encryptor.cpp
|
AesCfb128Encryptor.cpp
|
||||||
BlockingSslClientSocket.cpp
|
BlockingSslClientSocket.cpp
|
||||||
|
@ -18,7 +18,7 @@ set(SOURCES
|
||||||
X509Cert.cpp
|
X509Cert.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(HEADERS
|
set(HDRS
|
||||||
AesCfb128Decryptor.h
|
AesCfb128Decryptor.h
|
||||||
AesCfb128Encryptor.h
|
AesCfb128Encryptor.h
|
||||||
BlockingSslClientSocket.h
|
BlockingSslClientSocket.h
|
||||||
|
@ -33,8 +33,10 @@ set(HEADERS
|
||||||
X509Cert.h
|
X509Cert.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(PolarSSL++ ${SOURCES} ${HEADERS})
|
if(NOT MSVC)
|
||||||
|
add_library(PolarSSL++ ${SRCS} ${HDRS})
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_link_libraries(PolarSSL++ polarssl)
|
target_link_libraries(PolarSSL++ polarssl)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue