2020-05-16 19:59:10 +00:00
|
|
|
target_sources(
|
|
|
|
${CMAKE_PROJECT_NAME} PRIVATE
|
2013-12-10 18:41:43 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
Resources/Cuberite.rc
|
2014-08-10 18:34:11 +00:00
|
|
|
|
2014-07-18 21:08:49 +00:00
|
|
|
BiomeDef.cpp
|
|
|
|
BlockArea.cpp
|
|
|
|
BlockInfo.cpp
|
2020-04-03 06:57:01 +00:00
|
|
|
BlockType.cpp
|
2015-09-24 08:48:33 +00:00
|
|
|
BrewingRecipes.cpp
|
2015-03-21 17:17:26 +00:00
|
|
|
Broadcaster.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
BoundingBox.cpp
|
|
|
|
ByteBuffer.cpp
|
|
|
|
ChatColor.cpp
|
|
|
|
Chunk.cpp
|
|
|
|
ChunkData.cpp
|
2019-09-01 07:30:00 +00:00
|
|
|
ChunkGeneratorThread.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
ChunkMap.cpp
|
|
|
|
ChunkSender.cpp
|
|
|
|
ChunkStay.cpp
|
2021-01-11 16:39:43 +00:00
|
|
|
CircularBufferCompressor.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
ClientHandle.cpp
|
2015-07-14 00:15:37 +00:00
|
|
|
Color.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
CommandOutput.cpp
|
|
|
|
CompositeChat.cpp
|
|
|
|
CraftingRecipes.cpp
|
|
|
|
Cuboid.cpp
|
|
|
|
DeadlockDetect.cpp
|
2020-04-03 06:57:01 +00:00
|
|
|
Defines.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
Enchantments.cpp
|
2014-10-23 06:41:57 +00:00
|
|
|
FastRandom.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
FurnaceRecipe.cpp
|
|
|
|
Globals.cpp
|
2014-10-23 13:15:10 +00:00
|
|
|
IniFile.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
Inventory.cpp
|
|
|
|
Item.cpp
|
|
|
|
ItemGrid.cpp
|
2020-05-09 14:51:15 +00:00
|
|
|
JsonUtils.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
LightingThread.cpp
|
|
|
|
LineBlockTracer.cpp
|
|
|
|
LinearInterpolation.cpp
|
2014-08-12 15:05:04 +00:00
|
|
|
LoggerListeners.cpp
|
|
|
|
Logger.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
Map.cpp
|
|
|
|
MapManager.cpp
|
2015-05-14 14:47:51 +00:00
|
|
|
MemorySettingsRepository.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
MobCensus.cpp
|
|
|
|
MobFamilyCollecter.cpp
|
|
|
|
MobProximityCounter.cpp
|
|
|
|
MobSpawner.cpp
|
|
|
|
MonsterConfig.cpp
|
2015-05-27 01:35:28 +00:00
|
|
|
NetherPortalScanner.cpp
|
2015-05-14 14:47:51 +00:00
|
|
|
OverridesSettingsRepository.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
ProbabDistrib.cpp
|
2014-08-05 16:37:00 +00:00
|
|
|
RankManager.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
RCONServer.cpp
|
|
|
|
Root.cpp
|
|
|
|
Scoreboard.cpp
|
|
|
|
Server.cpp
|
2015-05-29 23:18:52 +00:00
|
|
|
SpawnPrepare.cpp
|
2021-05-04 15:11:56 +00:00
|
|
|
StatisticsManager.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
StringCompression.cpp
|
|
|
|
StringUtils.cpp
|
2017-08-25 12:43:18 +00:00
|
|
|
UUID.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
VoronoiMap.cpp
|
|
|
|
WebAdmin.cpp
|
|
|
|
World.cpp
|
2014-11-18 11:07:08 +00:00
|
|
|
main.cpp
|
2014-07-18 21:08:49 +00:00
|
|
|
|
|
|
|
BiomeDef.h
|
|
|
|
BlockArea.h
|
|
|
|
BlockInServerPluginInterface.h
|
|
|
|
BlockInfo.h
|
2020-12-21 13:54:04 +00:00
|
|
|
BlockState.h
|
2014-07-18 21:08:49 +00:00
|
|
|
BlockTracer.h
|
2020-04-03 06:57:01 +00:00
|
|
|
BlockType.h
|
2015-09-24 08:48:33 +00:00
|
|
|
BrewingRecipes.h
|
2014-07-18 21:08:49 +00:00
|
|
|
BoundingBox.h
|
2014-09-10 15:07:00 +00:00
|
|
|
BuildInfo.h.cmake
|
2014-07-18 21:08:49 +00:00
|
|
|
ByteBuffer.h
|
|
|
|
ChatColor.h
|
|
|
|
Chunk.h
|
|
|
|
ChunkData.h
|
|
|
|
ChunkDataCallback.h
|
|
|
|
ChunkDef.h
|
2019-09-01 07:30:00 +00:00
|
|
|
ChunkGeneratorThread.h
|
2014-07-18 21:08:49 +00:00
|
|
|
ChunkMap.h
|
|
|
|
ChunkSender.h
|
|
|
|
ChunkStay.h
|
2021-01-11 16:39:43 +00:00
|
|
|
CircularBufferCompressor.h
|
2014-07-18 21:08:49 +00:00
|
|
|
ClientHandle.h
|
2015-09-17 09:20:10 +00:00
|
|
|
Color.h
|
2014-07-18 21:08:49 +00:00
|
|
|
CommandOutput.h
|
|
|
|
CompositeChat.h
|
|
|
|
CraftingRecipes.h
|
|
|
|
Cuboid.h
|
|
|
|
DeadlockDetect.h
|
|
|
|
Defines.h
|
2015-11-23 23:39:19 +00:00
|
|
|
EffectID.h
|
2014-07-18 21:08:49 +00:00
|
|
|
Enchantments.h
|
|
|
|
Endianness.h
|
2014-10-23 06:41:57 +00:00
|
|
|
FastRandom.h
|
2014-07-18 21:08:49 +00:00
|
|
|
ForEachChunkProvider.h
|
|
|
|
FurnaceRecipe.h
|
2017-09-11 21:20:49 +00:00
|
|
|
FunctionRef.h
|
2014-07-18 21:08:49 +00:00
|
|
|
Globals.h
|
2014-10-23 13:15:10 +00:00
|
|
|
IniFile.h
|
2014-07-18 21:08:49 +00:00
|
|
|
Inventory.h
|
|
|
|
Item.h
|
|
|
|
ItemGrid.h
|
2018-01-21 18:45:13 +00:00
|
|
|
LazyArray.h
|
2020-05-09 14:51:15 +00:00
|
|
|
JsonUtils.h
|
2014-07-18 21:08:49 +00:00
|
|
|
LightingThread.h
|
|
|
|
LineBlockTracer.h
|
|
|
|
LinearInterpolation.h
|
|
|
|
LinearUpscale.h
|
2014-08-12 15:05:04 +00:00
|
|
|
Logger.h
|
|
|
|
LoggerListeners.h
|
2018-01-03 17:41:16 +00:00
|
|
|
LoggerSimple.h
|
2014-07-18 21:08:49 +00:00
|
|
|
Map.h
|
|
|
|
MapManager.h
|
|
|
|
Matrix4.h
|
2015-05-14 14:47:51 +00:00
|
|
|
MemorySettingsRepository.h
|
2014-07-18 21:08:49 +00:00
|
|
|
MobCensus.h
|
|
|
|
MobFamilyCollecter.h
|
|
|
|
MobProximityCounter.h
|
|
|
|
MobSpawner.h
|
|
|
|
MonsterConfig.h
|
2015-05-27 01:35:28 +00:00
|
|
|
NetherPortalScanner.h
|
2018-07-24 21:30:49 +00:00
|
|
|
OpaqueWorld.h
|
2015-05-14 14:47:51 +00:00
|
|
|
OverridesSettingsRepository.h
|
2014-07-18 21:08:49 +00:00
|
|
|
ProbabDistrib.h
|
2014-08-05 16:37:00 +00:00
|
|
|
RankManager.h
|
2014-07-18 21:08:49 +00:00
|
|
|
RCONServer.h
|
|
|
|
Root.h
|
|
|
|
Scoreboard.h
|
|
|
|
Server.h
|
2014-07-24 16:32:05 +00:00
|
|
|
SetChunkData.h
|
2015-05-14 14:47:51 +00:00
|
|
|
SettingsRepositoryInterface.h
|
2015-05-29 23:18:52 +00:00
|
|
|
SpawnPrepare.h
|
2021-05-04 15:11:56 +00:00
|
|
|
StatisticsManager.h
|
2014-07-18 21:08:49 +00:00
|
|
|
StringCompression.h
|
|
|
|
StringUtils.h
|
2017-08-25 12:43:18 +00:00
|
|
|
UUID.h
|
2014-07-18 21:08:49 +00:00
|
|
|
Vector3.h
|
|
|
|
VoronoiMap.h
|
|
|
|
WebAdmin.h
|
|
|
|
World.h
|
2014-11-18 11:07:08 +00:00
|
|
|
XMLParser.h
|
2020-10-05 10:27:14 +00:00
|
|
|
main.h
|
2014-11-18 11:07:08 +00:00
|
|
|
)
|
2014-07-18 21:08:49 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
set(FOLDERS
|
2020-07-18 13:22:14 +00:00
|
|
|
Bindings BlockEntities Blocks Entities
|
|
|
|
Generating HTTP Items mbedTLS++ Mobs Noise
|
2020-09-12 18:57:44 +00:00
|
|
|
OSSupport Physics Protocol Registries Simulator
|
2020-07-18 13:22:14 +00:00
|
|
|
Simulator/IncrementalRedstoneSimulator UI WorldStorage
|
2020-05-16 19:59:10 +00:00
|
|
|
)
|
2014-07-21 15:35:09 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
# Add all child source directories:
|
2014-07-21 15:35:09 +00:00
|
|
|
foreach(folder ${FOLDERS})
|
2020-05-16 19:59:10 +00:00
|
|
|
add_subdirectory(${folder})
|
2014-07-21 15:35:09 +00:00
|
|
|
endforeach(folder)
|
2013-12-10 18:41:43 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/include/Globals.h"
|
|
|
|
"/* This file allows Globals.h to be included with an absolute path */\n#include \"${PROJECT_SOURCE_DIR}/src/Globals.h\"\n")
|
2019-12-28 11:53:37 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
configure_file("BuildInfo.h.cmake" "${CMAKE_BINARY_DIR}/include/BuildInfo.h")
|
2020-09-12 18:57:44 +00:00
|
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}/include/" ".")
|
2019-12-28 11:53:37 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
# Generate AllFiles.lst for CheckBasicStyle.lua
|
|
|
|
get_target_property(ALL_FILES ${CMAKE_PROJECT_NAME} SOURCES)
|
|
|
|
foreach(FILE ${ALL_FILES})
|
|
|
|
# target_sources converts to absolute but CheckBasicStyle expects relative
|
|
|
|
file(RELATIVE_PATH RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" ${FILE})
|
2019-12-28 11:53:37 +00:00
|
|
|
|
2020-05-16 19:59:10 +00:00
|
|
|
# Convert CMake list into newline-delimited string
|
|
|
|
set(ALL_FILES_AS_LINES "${ALL_FILES_AS_LINES}${RELATIVE}\n")
|
|
|
|
endforeach()
|
|
|
|
file(WRITE AllFiles.lst "${ALL_FILES_AS_LINES}")
|
2013-12-28 13:42:11 +00:00
|
|
|
|
2015-09-08 07:12:02 +00:00
|
|
|
# Output the executable into the $/Server folder, so that it has access to external resources:
|
2016-11-07 22:15:07 +00:00
|
|
|
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES
|
2019-12-28 11:53:37 +00:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create a symbolic link from ${orig} to ${link}
|
2019-12-28 19:39:00 +00:00
|
|
|
# If the orig and link point to the same thing, does nothing (-> in-source build)
|
2019-12-28 11:53:37 +00:00
|
|
|
# If ${link} already exists, does nothing.
|
|
|
|
function(make_symlink orig link)
|
2019-12-28 19:39:00 +00:00
|
|
|
# If both are the same, or link already exists, bail out:
|
|
|
|
if ("${orig}" STREQUAL "${link}")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
if (EXISTS ${link})
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Create the symlink (platform-dependent):
|
2021-01-31 15:09:59 +00:00
|
|
|
message(STATUS "Creating symlink, orig = ${orig}; link = ${link}")
|
2019-12-28 19:39:00 +00:00
|
|
|
if (CMAKE_HOST_UNIX)
|
|
|
|
set(command ln -s ${orig} ${link})
|
|
|
|
else()
|
2019-12-29 09:28:11 +00:00
|
|
|
file(TO_NATIVE_PATH "${orig}" orig)
|
|
|
|
file(TO_NATIVE_PATH "${link}" link)
|
2019-12-28 19:39:00 +00:00
|
|
|
if (IS_DIRECTORY ${orig})
|
|
|
|
set(command cmd.exe /c mklink /j ${link} ${orig})
|
2019-12-28 11:53:37 +00:00
|
|
|
else()
|
2019-12-28 19:39:00 +00:00
|
|
|
set(command cmd.exe /c mklink /h ${link} ${orig})
|
2019-12-28 11:53:37 +00:00
|
|
|
endif()
|
2019-12-28 19:39:00 +00:00
|
|
|
endif()
|
2019-12-28 11:53:37 +00:00
|
|
|
|
2019-12-28 19:39:00 +00:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${command}
|
|
|
|
RESULT_VARIABLE result
|
2019-12-29 09:28:11 +00:00
|
|
|
ERROR_VARIABLE stderr
|
|
|
|
OUTPUT_VARIABLE stdout
|
2019-12-28 19:39:00 +00:00
|
|
|
)
|
2019-12-28 11:53:37 +00:00
|
|
|
|
2019-12-28 19:39:00 +00:00
|
|
|
if (NOT ${result} EQUAL 0)
|
2019-12-29 09:28:11 +00:00
|
|
|
message(FATAL_ERROR "Could not create symbolic link for: ${link} --> ${orig}: ${stderr} ${stdout}")
|
2019-12-28 11:53:37 +00:00
|
|
|
endif()
|
|
|
|
endfunction(make_symlink)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Populate the output folder with symlinks to the Server folder's internals:
|
|
|
|
set(symlinks
|
|
|
|
Install
|
|
|
|
Plugins
|
|
|
|
Prefabs
|
|
|
|
Protocol
|
|
|
|
webadmin
|
|
|
|
brewing.txt
|
|
|
|
crafting.txt
|
|
|
|
favicon.png
|
2019-12-30 17:05:19 +00:00
|
|
|
furnace.txt
|
2019-12-28 11:53:37 +00:00
|
|
|
items.ini
|
|
|
|
monsters.ini
|
2019-12-30 17:05:19 +00:00
|
|
|
README.txt
|
2014-01-16 17:33:28 +00:00
|
|
|
)
|
2021-01-31 15:09:59 +00:00
|
|
|
message(STATUS "Creating output folder and symlinks...")
|
2019-12-28 11:53:37 +00:00
|
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Server")
|
|
|
|
foreach (symlink ${symlinks})
|
2020-01-02 15:59:07 +00:00
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../Server/${symlink}" "${CMAKE_BINARY_DIR}/Server/${symlink}")
|
2019-12-28 11:53:37 +00:00
|
|
|
endforeach(symlink)
|
2020-01-02 15:59:07 +00:00
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../BACKERS" "${CMAKE_BINARY_DIR}/Server/BACKERS")
|
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../CONTRIBUTORS" "${CMAKE_BINARY_DIR}/Server/CONTRIBUTORS")
|
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE" "${CMAKE_BINARY_DIR}/Server/LICENSE")
|
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../Server/Install/ThirdPartyLicenses" "${CMAKE_BINARY_DIR}/Server/ThirdPartyLicenses")
|
2013-12-28 13:42:11 +00:00
|
|
|
|
2016-05-22 09:54:31 +00:00
|
|
|
# Create a folder for Bindings' documentation:
|
|
|
|
FILE(MAKE_DIRECTORY "Bindings/docs")
|
2020-01-02 15:59:07 +00:00
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/Bindings/docs" "${CMAKE_BINARY_DIR}/Server/BindingsDocs")
|