mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
TC cmake changes and dynamic linking support
This commit is contained in:
184
CMakeLists.txt
184
CMakeLists.txt
@@ -4,176 +4,40 @@
|
|||||||
# Please see the included DOCS/LICENSE.md for more information
|
# Please see the included DOCS/LICENSE.md for more information
|
||||||
#
|
#
|
||||||
|
|
||||||
if ( USE_COREPCH )
|
if( ${CMAKE_PROJECT_NAME} STREQUAL "MaNGOS" )
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Iterates through all the source files and adds them to the solution
|
if ( USE_COREPCH )
|
||||||
file(GLOB sources_localdir *.cpp *.h)
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR})
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Adds all the method headers to its own source group
|
# Iterates through all the source files and adds them to the solution
|
||||||
file(GLOB method_headers *Methods.h)
|
file(GLOB sources_localdir *.cpp *.h)
|
||||||
source_group("Methods" FILES ${method_headers})
|
|
||||||
|
|
||||||
set(LuaEngine_STAT_SRCS
|
# Adds all the method headers to its own source group
|
||||||
${LuaEngine_STAT_SRCS}
|
file(GLOB method_headers *Methods.h)
|
||||||
${sources_localdir}
|
source_group("Methods" FILES ${method_headers})
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(
|
set(LuaEngine_STAT_SRCS
|
||||||
${CMAKE_SOURCE_DIR}/dep/zlib
|
${LuaEngine_STAT_SRCS}
|
||||||
${CMAKE_SOURCE_DIR}/dep/lualib
|
${sources_localdir}
|
||||||
${CMAKE_BINARY_DIR}
|
)
|
||||||
${ACE_INCLUDE_DIR}
|
|
||||||
${MYSQL_INCLUDE_DIR}
|
|
||||||
${OPENSSL_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(LuaEngine STATIC
|
|
||||||
${LuaEngine_STAT_SRCS}
|
|
||||||
${game_STAT_SRCS}
|
|
||||||
${game_STAT_PCH_SRC}
|
|
||||||
)
|
|
||||||
|
|
||||||
if( ${CMAKE_PROJECT_NAME} STREQUAL "TrinityCore" )
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
${CMAKE_SOURCE_DIR}/dep/zlib
|
||||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
|
${CMAKE_SOURCE_DIR}/dep/lualib
|
||||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast/Include
|
${ACE_INCLUDE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/dep/g3dlite/include
|
${MYSQL_INCLUDE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
${OPENSSL_INCLUDE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/dep/cppformat
|
|
||||||
${CMAKE_SOURCE_DIR}/dep/mersennetwister
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Collision
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Management
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Maps
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Models
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Configuration
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Debugging
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Logging
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Threading
|
|
||||||
${CMAKE_SOURCE_DIR}/src/common/Utilities
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/database
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/database/Database
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/database/Logging
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/database/Updater
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Policies
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/shared/Service
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/ipc
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Accounts
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Achievements
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Addons
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Handlers
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AI
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds/Zones
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Calendar
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Chat
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Conditions
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Combat
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/DataStores
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/DungeonFinding
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/AreaTrigger
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Pet
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Player
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Transport
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Events
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Globals
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Grids
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Groups
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Guilds
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Instances
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Loot
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Mails
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Maps
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Opcodes
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Pools
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Quests
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Reputation
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Scripting
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Server
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Skills
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Spells
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Texts
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Tickets
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Tools
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/Weather
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/game/World
|
|
||||||
${CMAKE_SOURCE_DIR}/src/server/scripts/PrecompiledHeaders
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Boost COMPONENTS system filesystem REQUIRED)
|
add_library(LuaEngine STATIC
|
||||||
|
${LuaEngine_STAT_SRCS}
|
||||||
target_link_libraries(LuaEngine
|
${game_STAT_SRCS}
|
||||||
game
|
${game_STAT_PCH_SRC}
|
||||||
${Boost_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies(LuaEngine game)
|
|
||||||
|
|
||||||
if( WIN32 )
|
|
||||||
if ( MSVC )
|
|
||||||
add_custom_command(TARGET LuaEngine
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/extensions ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/
|
|
||||||
)
|
|
||||||
elseif ( MINGW )
|
|
||||||
add_custom_command(TARGET LuaEngine
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/extensions ${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( UNIX )
|
|
||||||
install(DIRECTORY extensions DESTINATION bin/lua_scripts/)
|
|
||||||
elseif( WIN32 )
|
|
||||||
install(DIRECTORY extensions DESTINATION "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
elseif( ${CMAKE_PROJECT_NAME} STREQUAL "MaNGOS" )
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_SOURCE_DIR}/dep/g3dlite
|
${CMAKE_SOURCE_DIR}/dep/g3dlite
|
||||||
${CMAKE_SOURCE_DIR}/src/shared
|
${CMAKE_SOURCE_DIR}/src/shared
|
||||||
|
|||||||
@@ -116,7 +116,10 @@ struct LuaScript
|
|||||||
#define ELUNA_OBJECT_STORE "Eluna Object Store"
|
#define ELUNA_OBJECT_STORE "Eluna Object Store"
|
||||||
#define LOCK_ELUNA Eluna::Guard __guard(Eluna::GetLock())
|
#define LOCK_ELUNA Eluna::Guard __guard(Eluna::GetLock())
|
||||||
|
|
||||||
class Eluna
|
#ifndef TRINITY
|
||||||
|
#define TC_GAME_API
|
||||||
|
#endif
|
||||||
|
class TC_GAME_API Eluna
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::list<LuaScript> ScriptList;
|
typedef std::list<LuaScript> ScriptList;
|
||||||
|
|||||||
Reference in New Issue
Block a user