2020-05-16 15:59:10 -04:00
|
|
|
target_sources(
|
|
|
|
${CMAKE_PROJECT_NAME} PRIVATE
|
2013-12-10 13:41:43 -05:00
|
|
|
|
2020-05-16 15:59:10 -04:00
|
|
|
Resources/Cuberite.rc
|
2014-08-10 14:34:11 -04:00
|
|
|
|
2014-07-18 17:08:49 -04:00
|
|
|
BiomeDef.cpp
|
|
|
|
BlockArea.cpp
|
|
|
|
BlockInfo.cpp
|
2020-04-03 02:57:01 -04:00
|
|
|
BlockType.cpp
|
2015-09-24 04:48:33 -04:00
|
|
|
BrewingRecipes.cpp
|
2015-03-21 13:17:26 -04:00
|
|
|
Broadcaster.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
BoundingBox.cpp
|
|
|
|
ByteBuffer.cpp
|
|
|
|
ChatColor.cpp
|
|
|
|
Chunk.cpp
|
|
|
|
ChunkData.cpp
|
2019-09-01 03:30:00 -04:00
|
|
|
ChunkGeneratorThread.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
ChunkMap.cpp
|
|
|
|
ChunkSender.cpp
|
|
|
|
ChunkStay.cpp
|
2021-01-11 11:39:43 -05:00
|
|
|
CircularBufferCompressor.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
ClientHandle.cpp
|
2015-07-13 20:15:37 -04:00
|
|
|
Color.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
CommandOutput.cpp
|
|
|
|
CompositeChat.cpp
|
|
|
|
CraftingRecipes.cpp
|
|
|
|
Cuboid.cpp
|
|
|
|
DeadlockDetect.cpp
|
2020-04-03 02:57:01 -04:00
|
|
|
Defines.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
Enchantments.cpp
|
2014-10-23 02:41:57 -04:00
|
|
|
FastRandom.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
FurnaceRecipe.cpp
|
|
|
|
Globals.cpp
|
2014-10-23 09:15:10 -04:00
|
|
|
IniFile.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
Inventory.cpp
|
|
|
|
Item.cpp
|
|
|
|
ItemGrid.cpp
|
2020-05-09 10:51:15 -04:00
|
|
|
JsonUtils.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
LightingThread.cpp
|
|
|
|
LineBlockTracer.cpp
|
|
|
|
LinearInterpolation.cpp
|
2014-08-12 11:05:04 -04:00
|
|
|
LoggerListeners.cpp
|
|
|
|
Logger.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
Map.cpp
|
|
|
|
MapManager.cpp
|
2015-05-14 10:47:51 -04:00
|
|
|
MemorySettingsRepository.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
MobCensus.cpp
|
|
|
|
MobFamilyCollecter.cpp
|
|
|
|
MobProximityCounter.cpp
|
|
|
|
MobSpawner.cpp
|
|
|
|
MonsterConfig.cpp
|
2015-05-26 21:35:28 -04:00
|
|
|
NetherPortalScanner.cpp
|
2015-05-14 10:47:51 -04:00
|
|
|
OverridesSettingsRepository.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
ProbabDistrib.cpp
|
2014-08-05 12:37:00 -04:00
|
|
|
RankManager.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
RCONServer.cpp
|
|
|
|
Root.cpp
|
|
|
|
Scoreboard.cpp
|
|
|
|
Server.cpp
|
2015-05-29 19:18:52 -04:00
|
|
|
SpawnPrepare.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
Statistics.cpp
|
|
|
|
StringCompression.cpp
|
|
|
|
StringUtils.cpp
|
2017-08-25 08:43:18 -04:00
|
|
|
UUID.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
VoronoiMap.cpp
|
|
|
|
WebAdmin.cpp
|
|
|
|
World.cpp
|
2014-11-18 06:07:08 -05:00
|
|
|
main.cpp
|
2014-07-18 17:08:49 -04:00
|
|
|
|
|
|
|
BiomeDef.h
|
|
|
|
BlockArea.h
|
|
|
|
BlockInServerPluginInterface.h
|
|
|
|
BlockInfo.h
|
2020-12-21 08:54:04 -05:00
|
|
|
BlockState.h
|
2014-07-18 17:08:49 -04:00
|
|
|
BlockTracer.h
|
2020-04-03 02:57:01 -04:00
|
|
|
BlockType.h
|
2015-09-24 04:48:33 -04:00
|
|
|
BrewingRecipes.h
|
2014-07-18 17:08:49 -04:00
|
|
|
BoundingBox.h
|
2014-09-10 11:07:00 -04:00
|
|
|
BuildInfo.h.cmake
|
2014-07-18 17:08:49 -04:00
|
|
|
ByteBuffer.h
|
|
|
|
ChatColor.h
|
|
|
|
Chunk.h
|
|
|
|
ChunkData.h
|
|
|
|
ChunkDataCallback.h
|
|
|
|
ChunkDef.h
|
2019-09-01 03:30:00 -04:00
|
|
|
ChunkGeneratorThread.h
|
2014-07-18 17:08:49 -04:00
|
|
|
ChunkMap.h
|
|
|
|
ChunkSender.h
|
|
|
|
ChunkStay.h
|
2021-01-11 11:39:43 -05:00
|
|
|
CircularBufferCompressor.h
|
2014-07-18 17:08:49 -04:00
|
|
|
ClientHandle.h
|
2015-09-17 05:20:10 -04:00
|
|
|
Color.h
|
2014-07-18 17:08:49 -04:00
|
|
|
CommandOutput.h
|
|
|
|
CompositeChat.h
|
|
|
|
CraftingRecipes.h
|
|
|
|
Cuboid.h
|
|
|
|
DeadlockDetect.h
|
|
|
|
Defines.h
|
2015-11-23 18:39:19 -05:00
|
|
|
EffectID.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Enchantments.h
|
|
|
|
Endianness.h
|
2014-10-23 02:41:57 -04:00
|
|
|
FastRandom.h
|
2014-07-18 17:08:49 -04:00
|
|
|
ForEachChunkProvider.h
|
|
|
|
FurnaceRecipe.h
|
2017-09-11 17:20:49 -04:00
|
|
|
FunctionRef.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Globals.h
|
2014-10-23 09:15:10 -04:00
|
|
|
IniFile.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Inventory.h
|
|
|
|
Item.h
|
|
|
|
ItemGrid.h
|
2018-01-21 13:45:13 -05:00
|
|
|
LazyArray.h
|
2020-05-09 10:51:15 -04:00
|
|
|
JsonUtils.h
|
2014-07-18 17:08:49 -04:00
|
|
|
LightingThread.h
|
|
|
|
LineBlockTracer.h
|
|
|
|
LinearInterpolation.h
|
|
|
|
LinearUpscale.h
|
2014-08-12 11:05:04 -04:00
|
|
|
Logger.h
|
|
|
|
LoggerListeners.h
|
2018-01-03 12:41:16 -05:00
|
|
|
LoggerSimple.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Map.h
|
|
|
|
MapManager.h
|
|
|
|
Matrix4.h
|
2015-05-14 10:47:51 -04:00
|
|
|
MemorySettingsRepository.h
|
2014-07-18 17:08:49 -04:00
|
|
|
MobCensus.h
|
|
|
|
MobFamilyCollecter.h
|
|
|
|
MobProximityCounter.h
|
|
|
|
MobSpawner.h
|
|
|
|
MonsterConfig.h
|
2015-05-26 21:35:28 -04:00
|
|
|
NetherPortalScanner.h
|
2018-07-24 17:30:49 -04:00
|
|
|
OpaqueWorld.h
|
2015-05-14 10:47:51 -04:00
|
|
|
OverridesSettingsRepository.h
|
2014-07-18 17:08:49 -04:00
|
|
|
ProbabDistrib.h
|
2014-08-05 12:37:00 -04:00
|
|
|
RankManager.h
|
2014-07-18 17:08:49 -04:00
|
|
|
RCONServer.h
|
|
|
|
Root.h
|
|
|
|
Scoreboard.h
|
|
|
|
Server.h
|
2014-07-24 12:32:05 -04:00
|
|
|
SetChunkData.h
|
2015-05-14 10:47:51 -04:00
|
|
|
SettingsRepositoryInterface.h
|
2015-05-29 19:18:52 -04:00
|
|
|
SpawnPrepare.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Statistics.h
|
2015-11-11 04:32:42 -05:00
|
|
|
Stopwatch.h
|
2014-07-18 17:08:49 -04:00
|
|
|
StringCompression.h
|
|
|
|
StringUtils.h
|
2017-08-25 08:43:18 -04:00
|
|
|
UUID.h
|
2014-07-18 17:08:49 -04:00
|
|
|
Vector3.h
|
|
|
|
VoronoiMap.h
|
|
|
|
WebAdmin.h
|
|
|
|
World.h
|
2014-11-18 06:07:08 -05:00
|
|
|
XMLParser.h
|
2020-10-05 06:27:14 -04:00
|
|
|
main.h
|
2014-11-18 06:07:08 -05:00
|
|
|
)
|
2014-07-18 17:08:49 -04:00
|
|
|
|
2020-05-16 15:59:10 -04:00
|
|
|
set(FOLDERS
|
2020-07-18 09:22:14 -04:00
|
|
|
Bindings BlockEntities Blocks Entities
|
|
|
|
Generating HTTP Items mbedTLS++ Mobs Noise
|
2020-09-12 14:57:44 -04:00
|
|
|
OSSupport Physics Protocol Registries Simulator
|
2020-07-18 09:22:14 -04:00
|
|
|
Simulator/IncrementalRedstoneSimulator UI WorldStorage
|
2020-05-16 15:59:10 -04:00
|
|
|
)
|
2014-07-21 11:35:09 -04:00
|
|
|
|
2020-05-16 15:59:10 -04:00
|
|
|
# Add all child source directories:
|
2014-07-21 11:35:09 -04:00
|
|
|
foreach(folder ${FOLDERS})
|
2020-05-16 15:59:10 -04:00
|
|
|
add_subdirectory(${folder})
|
2014-07-21 11:35:09 -04:00
|
|
|
endforeach(folder)
|
2013-12-10 13:41:43 -05:00
|
|
|
|
2020-05-16 15:59:10 -04: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 06:53:37 -05:00
|
|
|
|
2020-05-16 15:59:10 -04:00
|
|
|
configure_file("BuildInfo.h.cmake" "${CMAKE_BINARY_DIR}/include/BuildInfo.h")
|
2020-09-12 14:57:44 -04:00
|
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}/include/" ".")
|
2019-12-28 06:53:37 -05:00
|
|
|
|
2020-05-16 15:59:10 -04: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 06:53:37 -05:00
|
|
|
|
2020-05-16 15:59:10 -04: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 08:42:11 -05:00
|
|
|
|
2015-09-08 03:12:02 -04:00
|
|
|
# Output the executable into the $/Server folder, so that it has access to external resources:
|
2016-11-07 17:15:07 -05:00
|
|
|
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES
|
2019-12-28 06:53:37 -05: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 14:39:00 -05:00
|
|
|
# If the orig and link point to the same thing, does nothing (-> in-source build)
|
2019-12-28 06:53:37 -05:00
|
|
|
# If ${link} already exists, does nothing.
|
|
|
|
function(make_symlink orig link)
|
2019-12-28 14:39:00 -05: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 10:09:59 -05:00
|
|
|
message(STATUS "Creating symlink, orig = ${orig}; link = ${link}")
|
2019-12-28 14:39:00 -05:00
|
|
|
if (CMAKE_HOST_UNIX)
|
|
|
|
set(command ln -s ${orig} ${link})
|
|
|
|
else()
|
2019-12-29 04:28:11 -05:00
|
|
|
file(TO_NATIVE_PATH "${orig}" orig)
|
|
|
|
file(TO_NATIVE_PATH "${link}" link)
|
2019-12-28 14:39:00 -05:00
|
|
|
if (IS_DIRECTORY ${orig})
|
|
|
|
set(command cmd.exe /c mklink /j ${link} ${orig})
|
2019-12-28 06:53:37 -05:00
|
|
|
else()
|
2019-12-28 14:39:00 -05:00
|
|
|
set(command cmd.exe /c mklink /h ${link} ${orig})
|
2019-12-28 06:53:37 -05:00
|
|
|
endif()
|
2019-12-28 14:39:00 -05:00
|
|
|
endif()
|
2019-12-28 06:53:37 -05:00
|
|
|
|
2019-12-28 14:39:00 -05:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${command}
|
|
|
|
RESULT_VARIABLE result
|
2019-12-29 04:28:11 -05:00
|
|
|
ERROR_VARIABLE stderr
|
|
|
|
OUTPUT_VARIABLE stdout
|
2019-12-28 14:39:00 -05:00
|
|
|
)
|
2019-12-28 06:53:37 -05:00
|
|
|
|
2019-12-28 14:39:00 -05:00
|
|
|
if (NOT ${result} EQUAL 0)
|
2019-12-29 04:28:11 -05:00
|
|
|
message(FATAL_ERROR "Could not create symbolic link for: ${link} --> ${orig}: ${stderr} ${stdout}")
|
2019-12-28 06:53:37 -05: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 12:05:19 -05:00
|
|
|
furnace.txt
|
2019-12-28 06:53:37 -05:00
|
|
|
items.ini
|
|
|
|
monsters.ini
|
2019-12-30 12:05:19 -05:00
|
|
|
README.txt
|
2014-01-16 12:33:28 -05:00
|
|
|
)
|
2021-01-31 10:09:59 -05:00
|
|
|
message(STATUS "Creating output folder and symlinks...")
|
2019-12-28 06:53:37 -05:00
|
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Server")
|
|
|
|
foreach (symlink ${symlinks})
|
2020-01-02 10:59:07 -05:00
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/../Server/${symlink}" "${CMAKE_BINARY_DIR}/Server/${symlink}")
|
2019-12-28 06:53:37 -05:00
|
|
|
endforeach(symlink)
|
2020-01-02 10:59:07 -05: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 08:42:11 -05:00
|
|
|
|
2016-05-22 05:54:31 -04:00
|
|
|
# Create a folder for Bindings' documentation:
|
|
|
|
FILE(MAKE_DIRECTORY "Bindings/docs")
|
2020-01-02 10:59:07 -05:00
|
|
|
make_symlink("${CMAKE_CURRENT_SOURCE_DIR}/Bindings/docs" "${CMAKE_BINARY_DIR}/Server/BindingsDocs")
|