1
0
cuberite-2a/src/CMakeLists.txt

274 lines
6.3 KiB
CMake
Raw Normal View History

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