[c12538] Do not use GLOB in CMake for source file lists

From the CMake documentation of the FILE command:
"We do not recommend using GLOB to collect a list of source files from your
source tree. If no CMakeLists.txt file changes when a source is added or
removed then the generated build system cannot know when to ask CMake to
regenerate."

(based on commit [12390] - f123635)

Signed-off-by: DasBlub <DasBlub@gmail.com>
This commit is contained in:
DasBlub 2013-03-03 18:37:03 +01:00 committed by Antz
parent a27787851c
commit 7b52873e24
9 changed files with 656 additions and 117 deletions

View file

@ -16,48 +16,107 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# file(GLOB g3dlite_SRCS *.cpp) # don't need all of them set(LIBRARY_NAME g3dlite)
set(g3dlite_SRCS set(LIBRARY_SRCS
AABox.cpp AABox.cpp
Box.cpp Any.cpp
Crypto.cpp #AnyVal.cpp
format.cpp #AreaMemoryManager.cpp
Matrix3.cpp BinaryFormat.cpp
Plane.cpp BinaryInput.cpp
System.cpp BinaryOutput.cpp
Triangle.cpp Box.cpp
Vector3.cpp #Box2D.cpp
Vector4.cpp #BumpMapPreprocess.cpp
debugAssert.cpp Capsule.cpp
fileutils.cpp CollisionDetection.cpp
g3dmath.cpp #Color1.cpp
g3dfnmatch.cpp #Color1uint8.cpp
prompt.cpp #Color3.cpp
stringutils.cpp #Color3uint8.cpp
Any.cpp #Color4.cpp
BinaryFormat.cpp #Color4uint8.cpp
BinaryInput.cpp #Cone.cpp
BinaryOutput.cpp #ConvexPolyhedron.cpp
Capsule.cpp CoordinateFrame.cpp
CollisionDetection.cpp Crypto.cpp
CoordinateFrame.cpp #Crypto_md5.cpp
Cylinder.cpp Cylinder.cpp
Line.cpp FileSystem.cpp
LineSegment.cpp #GCamera.cpp
Log.cpp #GImage.cpp
Matrix4.cpp #GImage_bayer.cpp
MemoryManager.cpp #GImage_bmp.cpp
Quat.cpp #GImage_jpeg.cpp
Random.cpp #GImage_png.cpp
Ray.cpp #GImage_ppm.cpp
ReferenceCount.cpp #GImage_tga.cpp
RegistryUtil.cpp #GLight.cpp
Sphere.cpp #GThread.cpp
TextInput.cpp #GUniqueID.cpp
TextOutput.cpp #Image1.cpp
UprightFrame.cpp #Image1uint8.cpp
Vector2.cpp #Image3.cpp
#Image3uint8.cpp
#Image4.cpp
#Image4uint8.cpp
#ImageFormat.cpp
#ImageFormat_convert.cpp
#Intersect.cpp
Line.cpp
LineSegment.cpp
Log.cpp
#Matrix.cpp
Matrix3.cpp
Matrix4.cpp
MemoryManager.cpp
#MeshAlg.cpp
#MeshAlgAdjacency.cpp
#MeshAlgWeld.cpp
#MeshBuilder.cpp
#NetAddress.cpp
#NetworkDevice.cpp
PhysicsFrame.cpp
#PhysicsFrameSpline.cpp
Plane.cpp
#PrecomputedRandom.cpp
Quat.cpp
Random.cpp
Ray.cpp
#Rect2D.cpp
ReferenceCount.cpp
RegistryUtil.cpp
Sphere.cpp
#SplineBase.cpp
#Stopwatch.cpp
System.cpp
TextInput.cpp
TextOutput.cpp
#ThreadSet.cpp
Triangle.cpp
UprightFrame.cpp
Vector2.cpp
#Vector2int16.cpp
Vector3.cpp
#Vector3int16.cpp
#Vector3int32.cpp
Vector4.cpp
#Vector4int8.cpp
#Welder.cpp
#WinMain.cpp
#XML.cpp
#constants.cpp
debugAssert.cpp
fileutils.cpp
#filter.cpp
format.cpp
g3dfnmatch.cpp
g3dmath.cpp
#license.cpp
prompt.cpp
stringutils.cpp
uint128.cpp
) )
include_directories( include_directories(
@ -67,12 +126,12 @@ include_directories(
${CMAKE_SOURCE_DIR}/dep/include/zlib ${CMAKE_SOURCE_DIR}/dep/include/zlib
) )
add_library(g3dlite STATIC add_library(${LIBRARY_NAME} STATIC
${g3dlite_SRCS} ${LIBRARY_SRCS}
) )
if(WIN32) if(WIN32)
target_link_libraries(g3dlite target_link_libraries(${LIBRARY_NAME}
zlib zlib
) )
endif() endif()

View file

@ -16,13 +16,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
file(GLOB gsoap_SRCS *.cpp) set(LIBRARY_NAME gsoap)
set(LIBRARY_SRCS
stdsoap2.cpp
)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/dep/include/gsoap ${CMAKE_SOURCE_DIR}/dep/include/gsoap
) )
add_library(gsoap STATIC add_library(${LIBRARY_NAME} STATIC
${gsoap_SRCS} ${LIBRARY_SRCS}
) )

View file

@ -16,7 +16,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
file(GLOB_RECURSE mangosscript_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) set(LIBRARY_NAME mangosscript)
set(LIBRARY_SRCS
config.h
ScriptMgr.cpp
ScriptMgr.h
system.cpp
Scripts/sc_default.cpp
Scripts/sc_defines.cpp
Scripts/sc_defines.h
)
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/src/shared ${CMAKE_SOURCE_DIR}/src/shared
@ -26,60 +36,59 @@ include_directories(
${MYSQL_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR}
) )
add_library(mangosscript SHARED add_library(${LIBRARY_NAME} SHARED
${mangosscript_SRCS} ${LIBRARY_SRCS}
) )
add_dependencies(mangosscript revision.h) add_dependencies(${LIBRARY_NAME} revision.h)
if(NOT ACE_USE_EXTERNAL) if(NOT ACE_USE_EXTERNAL)
add_dependencies(mangosscript ACE_Project) add_dependencies(${LIBRARY_NAME} ACE_Project)
# add_dependencies(mangosscript ace)
endif() endif()
target_link_libraries(mangosscript target_link_libraries(${LIBRARY_NAME}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${ACE_LIBRARIES} ${ACE_LIBRARIES}
) )
if(WIN32) if(WIN32)
target_link_libraries(mangosscript target_link_libraries(${LIBRARY_NAME}
mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs
) )
if(WIN32 AND PLATFORM MATCHES X86) if(WIN32 AND PLATFORM MATCHES X86)
target_link_libraries(mangosscript target_link_libraries(${LIBRARY_NAME}
debug ${WIN_DEBUGLIBS} debug ${WIN_DEBUGLIBS}
) )
endif() endif()
endif() endif()
if(UNIX) if(UNIX)
set(mangosscript_LINK_FLAGS "-pthread") set(LIBRARY_LINK_FLAGS "-pthread")
if(APPLE) if(APPLE)
set(mangosscript_LINK_FLAGS "-framework Carbon ${mangosscript_LINK_FLAGS}") set(LIBRARY_LINK_FLAGS "-framework Carbon ${LIBRARY_LINK_FLAGS}")
# Needed for the linking because of the missing symbols # Needed for the linking because of the missing symbols
set(mangosscript_LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup ${mangosscript_LINK_FLAGS}") set(LIBRARY_LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup ${LIBRARY_LINK_FLAGS}")
endif() endif()
if(APPLE) if(APPLE)
set(mangosscript_PROPERTIES INSTALL_NAME_DIR "${LIBS_DIR}") set(LIBRARY_PROPERTIES INSTALL_NAME_DIR "${LIBS_DIR}")
else() else()
set(mangosscript_PROPERTIES INSTALL_RPATH ${LIBS_DIR}) set(LIBRARY_PROPERTIES INSTALL_RPATH ${LIBS_DIR})
endif() endif()
# Run out of build tree # Run out of build tree
set(mangosscript_PROPERTIES set(LIBRARY_PROPERTIES
${mangosscript_PROPERTIES} ${LIBRARY_PROPERTIES}
BUILD_WITH_INSTALL_RPATH OFF BUILD_WITH_INSTALL_RPATH OFF
) )
set_target_properties(mangosscript PROPERTIES set_target_properties(${LIBRARY_NAME} PROPERTIES
LINK_FLAGS ${mangosscript_LINK_FLAGS} LINK_FLAGS ${LIBRARY_LINK_FLAGS}
${mangosscript_PROPERTIES} ${LIBRARY_PROPERTIES}
) )
endif() endif()
# LIBRARY = dyld / so, RUNTIME = dll # LIBRARY = dyld / so, RUNTIME = dll
install(TARGETS mangosscript install(TARGETS ${LIBRARY_NAME}
LIBRARY DESTINATION ${LIBS_DIR} LIBRARY DESTINATION ${LIBS_DIR}
RUNTIME DESTINATION ${LIBS_DIR} RUNTIME DESTINATION ${LIBS_DIR}
) )

View file

@ -16,9 +16,37 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# include(${CMAKE_SOURCE_DIR}/dep/tbb/tbbinclude.cmake) set(LIBRARY_NAME framework)
file(GLOB_RECURSE framework_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) set(LIBRARY_SRCS
Dynamic/FactoryHolder.h
Dynamic/ObjectRegistry.h
GameSystem/Grid.h
GameSystem/GridLoader.h
GameSystem/GridReference.h
GameSystem/GridRefManager.h
GameSystem/NGrid.h
GameSystem/TypeContainer.h
GameSystem/TypeContainerFunctions.h
GameSystem/TypeContainerVisitor.h
Platform/CompilerDefs.h
Platform/Define.h
Policies/CreationPolicy.h
Policies/MemoryManagement.cpp
Policies/ObjectLifeTime.cpp
Policies/ObjectLifeTime.h
Policies/Singleton.h
Policies/ThreadingModel.h
Utilities/ByteConverter.h
Utilities/Callback.h
Utilities/EventProcessor.cpp
Utilities/EventProcessor.h
Utilities/LinkedList.h
Utilities/LinkedReference/Reference.h
Utilities/LinkedReference/RefManager.h
Utilities/TypeList.h
Utilities/UnorderedMapSet.h
)
source_group("Other" source_group("Other"
REGULAR_EXPRESSION .* REGULAR_EXPRESSION .*
@ -53,20 +81,17 @@ include_directories(
${ACE_INCLUDE_DIR} ${ACE_INCLUDE_DIR}
) )
add_library(framework STATIC add_library(${LIBRARY_NAME} STATIC
${framework_SRCS} ${LIBRARY_SRCS}
) )
if(NOT TBB_USE_EXTERNAL) if(NOT TBB_USE_EXTERNAL)
add_dependencies(framework TBB_Project) add_dependencies(${LIBRARY_NAME} TBB_Project)
# add_dependencies(framework tbb)
# add_dependencies(framework tbbmalloc)
endif() endif()
if(NOT ACE_USE_EXTERNAL) if(NOT ACE_USE_EXTERNAL)
add_dependencies(framework ACE_Project) add_dependencies(${LIBRARY_NAME} ACE_Project)
# add_dependencies(framework ace)
endif() endif()
target_link_libraries(framework target_link_libraries(${LIBRARY_NAME}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
) )

View file

@ -16,7 +16,357 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
file(GLOB_RECURSE game_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) set(LIBRARY_NAME game)
set(LIBRARY_SRCS
AccountMgr.cpp
AccountMgr.h
AchievementMgr.cpp
AchievementMgr.h
AggressorAI.cpp
AggressorAI.h
ArenaTeam.cpp
ArenaTeam.h
ArenaTeamHandler.cpp
AuctionHouseBot/AuctionHouseBot.cpp
AuctionHouseBot/AuctionHouseBot.h
AuctionHouseHandler.cpp
AuctionHouseMgr.cpp
AuctionHouseMgr.h
Bag.cpp
Bag.h
BattleGround/BattleGround.cpp
BattleGround/BattleGround.h
BattleGround/BattleGroundAA.cpp
BattleGround/BattleGroundAA.h
BattleGround/BattleGroundAB.cpp
BattleGround/BattleGroundAB.h
BattleGround/BattleGroundAV.cpp
BattleGround/BattleGroundAV.h
BattleGround/BattleGroundBE.cpp
BattleGround/BattleGroundBE.h
BattleGround/BattleGroundDS.cpp
BattleGround/BattleGroundDS.h
BattleGround/BattleGroundEY.cpp
BattleGround/BattleGroundEY.h
BattleGround/BattleGroundHandler.cpp
BattleGround/BattleGroundIC.cpp
BattleGround/BattleGroundIC.h
BattleGround/BattleGroundMgr.cpp
BattleGround/BattleGroundMgr.h
BattleGround/BattleGroundNA.cpp
BattleGround/BattleGroundNA.h
BattleGround/BattleGroundRB.cpp
BattleGround/BattleGroundRB.h
BattleGround/BattleGroundRL.cpp
BattleGround/BattleGroundRL.h
BattleGround/BattleGroundRV.cpp
BattleGround/BattleGroundRV.h
BattleGround/BattleGroundSA.cpp
BattleGround/BattleGroundSA.h
BattleGround/BattleGroundWS.cpp
BattleGround/BattleGroundWS.h
Calendar.cpp
Calendar.h
CalendarHandler.cpp
Camera.cpp
Camera.h
Cell.h
CellImpl.h
Channel.cpp
Channel.h
ChannelHandler.cpp
ChannelMgr.cpp
ChannelMgr.h
CharacterDatabaseCleaner.cpp
CharacterDatabaseCleaner.h
CharacterHandler.cpp
Chat.cpp
Chat.h
ChatHandler.cpp
CombatHandler.cpp
ConfusedMovementGenerator.cpp
ConfusedMovementGenerator.h
Corpse.cpp
Corpse.h
Creature.cpp
Creature.h
CreatureAI.cpp
CreatureAI.h
CreatureAIImpl.h
CreatureAIRegistry.cpp
CreatureAIRegistry.h
CreatureAISelector.cpp
CreatureAISelector.h
CreatureEventAI.cpp
CreatureEventAI.h
CreatureEventAIMgr.cpp
CreatureEventAIMgr.h
CreatureLinkingMgr.cpp
CreatureLinkingMgr.h
DB2fmt.h
DB2Stores.cpp
DB2Stores.h
DB2Structure.h
DBCEnums.h
DBCfmt.h
DBCStores.cpp
DBCStores.h
DBCStructure.cpp
DBCStructure.h
debugcmds.cpp
DuelHandler.cpp
DynamicObject.cpp
DynamicObject.h
FleeingMovementGenerator.cpp
FleeingMovementGenerator.h
FollowerReference.cpp
FollowerReference.h
FollowerRefManager.h
Formulas.h
GameEventMgr.cpp
GameEventMgr.h
GameObject.cpp
GameObject.h
GMTicketHandler.cpp
GMTicketMgr.cpp
GMTicketMgr.h
GossipDef.cpp
GossipDef.h
GridDefines.h
GridMap.cpp
GridMap.h
GridNotifiers.cpp
GridNotifiers.h
GridNotifiersImpl.h
GridStates.cpp
GridStates.h
Group.cpp
Group.h
GroupHandler.cpp
GroupReference.cpp
GroupReference.h
GroupRefManager.h
GuardAI.cpp
GuardAI.h
Guild.cpp
Guild.h
GuildHandler.cpp
GuildMgr.cpp
GuildMgr.h
HomeMovementGenerator.cpp
HomeMovementGenerator.h
HostileRefManager.cpp
HostileRefManager.h
IdleMovementGenerator.cpp
IdleMovementGenerator.h
InstanceData.cpp
InstanceData.h
Item.cpp
Item.h
ItemEnchantmentMgr.cpp
ItemEnchantmentMgr.h
ItemHandler.cpp
ItemPrototype.h
Language.h
Level0.cpp
Level1.cpp
Level2.cpp
Level3.cpp
LFGHandler.cpp
LootHandler.cpp
LootMgr.cpp
LootMgr.h
Mail.cpp
Mail.h
MailHandler.cpp
Map.cpp
Map.h
MapManager.cpp
MapManager.h
MapPersistentStateMgr.cpp
MapPersistentStateMgr.h
MapReference.h
MapRefManager.h
MassMailMgr.cpp
MassMailMgr.h
MiscHandler.cpp
MotionMaster.cpp
MotionMaster.h
MoveMap.cpp
MoveMap.h
MoveMapSharedDefines.h
movement/MoveSpline.cpp
movement/MoveSpline.h
movement/MoveSplineFlag.h
movement/MoveSplineInit.cpp
movement/MoveSplineInit.h
movement/MoveSplineInitArgs.h
movement/packet_builder.cpp
movement/packet_builder.h
movement/spline.cpp
movement/spline.h
movement/spline.impl.h
movement/typedefs.h
movement/util.cpp
MovementGenerator.cpp
MovementGenerator.h
MovementGeneratorImpl.h
MovementHandler.cpp
MovementStructures.h
NPCHandler.cpp
NPCHandler.h
NullCreatureAI.cpp
NullCreatureAI.h
Object.cpp
Object.h
ObjectAccessor.cpp
ObjectAccessor.h
ObjectGridLoader.cpp
ObjectGridLoader.h
ObjectGuid.cpp
ObjectGuid.h
ObjectMgr.cpp
ObjectMgr.h
ObjectPosSelector.cpp
ObjectPosSelector.h
Opcodes.cpp
Opcodes.h
OutdoorPvP/OutdoorPvP.cpp
OutdoorPvP/OutdoorPvP.h
OutdoorPvP/OutdoorPvPEP.cpp
OutdoorPvP/OutdoorPvPEP.h
OutdoorPvP/OutdoorPvPGH.cpp
OutdoorPvP/OutdoorPvPGH.h
OutdoorPvP/OutdoorPvPHP.cpp
OutdoorPvP/OutdoorPvPHP.h
OutdoorPvP/OutdoorPvPMgr.cpp
OutdoorPvP/OutdoorPvPMgr.h
OutdoorPvP/OutdoorPvPNA.cpp
OutdoorPvP/OutdoorPvPNA.h
OutdoorPvP/OutdoorPvPSI.cpp
OutdoorPvP/OutdoorPvPSI.h
OutdoorPvP/OutdoorPvPTF.cpp
OutdoorPvP/OutdoorPvPTF.h
OutdoorPvP/OutdoorPvPZM.cpp
OutdoorPvP/OutdoorPvPZM.h
Path.h
PathFinder.cpp
PathFinder.h
pchdef.cpp
pchdef.h
Pet.cpp
Pet.h
PetAI.cpp
PetAI.h
PetHandler.cpp
PetitionsHandler.cpp
Player.cpp
Player.h
PlayerDump.cpp
PlayerDump.h
PointMovementGenerator.cpp
PointMovementGenerator.h
PoolManager.cpp
PoolManager.h
QueryHandler.cpp
QuestDef.cpp
QuestDef.h
QuestHandler.cpp
RandomMovementGenerator.cpp
RandomMovementGenerator.h
ReactorAI.cpp
ReactorAI.h
ReputationMgr.cpp
ReputationMgr.h
ScriptMgr.cpp
ScriptMgr.h
SharedDefines.h
SkillDiscovery.cpp
SkillDiscovery.h
SkillExtraItems.cpp
SkillExtraItems.h
SkillHandler.cpp
SocialMgr.cpp
SocialMgr.h
Spell.cpp
Spell.h
SpellAuraDefines.h
SpellAuras.cpp
SpellAuras.h
SpellEffects.cpp
SpellHandler.cpp
SpellMgr.cpp
SpellMgr.h
SQLStorages.cpp
SQLStorages.h
StatSystem.cpp
TargetedMovementGenerator.cpp
TargetedMovementGenerator.h
TaxiHandler.cpp
TemporarySummon.cpp
TemporarySummon.h
ThreatManager.cpp
ThreatManager.h
Totem.cpp
Totem.h
TotemAI.cpp
TotemAI.h
TradeHandler.cpp
Transports.cpp
Transports.h
TransportSystem.cpp
TransportSystem.h
Unit.cpp
Unit.h
UnitAuraProcHandler.cpp
UnitEvents.h
UpdateData.cpp
UpdateData.h
UpdateFields.h
UpdateMask.h
Vehicle.cpp
Vehicle.h
VehicleHandler.cpp
vmap/BIH.cpp
vmap/BIH.h
vmap/BIHWrap.h
vmap/DynamicTree.cpp
vmap/DynamicTree.h
vmap/GameObjectModel.cpp
vmap/GameObjectModel.h
vmap/IVMapManager.h
vmap/MapTree.cpp
vmap/MapTree.h
vmap/ModelInstance.cpp
vmap/ModelInstance.h
vmap/RegularGrid.h
vmap/TileAssembler.cpp
vmap/TileAssembler.h
vmap/VMapDefinitions.h
vmap/VMapFactory.cpp
vmap/VMapFactory.h
vmap/VMapManager2.cpp
vmap/VMapManager2.h
vmap/VMapTools.h
vmap/WorldModel.cpp
vmap/WorldModel.h
VoiceChatHandler.cpp
WaypointManager.cpp
WaypointManager.h
WaypointMovementGenerator.cpp
WaypointMovementGenerator.h
Weather.cpp
Weather.h
World.cpp
World.h
WorldSession.cpp
WorldSession.h
WorldSocket.cpp
WorldSocket.h
WorldSocketMgr.cpp
WorldSocketMgr.h
)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@ -80,11 +430,11 @@ if(PCH)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif() endif()
add_library(game STATIC add_library(${LIBRARY_NAME} STATIC
${game_SRCS} ${LIBRARY_SRCS}
) )
target_link_libraries(game target_link_libraries(${LIBRARY_NAME}
shared shared
detour detour
) )
@ -92,16 +442,15 @@ target_link_libraries(game
if(UNIX) if(UNIX)
# Both systems don't have libdl and don't need them # Both systems don't have libdl and don't need them
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")) if (NOT (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD"))
target_link_libraries(game target_link_libraries(${LIBRARY_NAME}
dl dl
) )
endif() endif()
endif() endif()
add_dependencies(game revision.h) add_dependencies(${LIBRARY_NAME} revision.h)
if(NOT ACE_USE_EXTERNAL) if(NOT ACE_USE_EXTERNAL)
add_dependencies(game ACE_Project) add_dependencies(${LIBRARY_NAME} ACE_Project)
# add_dependencies(game ace)
endif() endif()
# Generate precompiled header # Generate precompiled header
@ -110,12 +459,11 @@ if(PCH)
if(MSVC) if(MSVC)
set(game_pch "${CMAKE_CURRENT_SOURCE_DIR}/pchdef.cpp") set(game_pch "${CMAKE_CURRENT_SOURCE_DIR}/pchdef.cpp")
endif() endif()
add_native_precompiled_header(game ${CMAKE_CURRENT_SOURCE_DIR}/pchdef.h) add_native_precompiled_header(${LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/pchdef.h)
elseif(CMAKE_COMPILER_IS_GNUCXX) elseif(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(game ${CMAKE_CURRENT_SOURCE_DIR}/pchdef.h) add_precompiled_header(${LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/pchdef.h)
if(NOT ACE_USE_EXTERNAL) if(NOT ACE_USE_EXTERNAL)
add_dependencies(game_pch_dephelp ACE_Project) add_dependencies(game_pch_dephelp ACE_Project)
# add_dependencies(game_pch_dephelp ace)
endif() endif()
endif() endif()
endif() endif()

View file

@ -17,12 +17,28 @@
# #
set(EXECUTABLE_NAME mangosd) set(EXECUTABLE_NAME mangosd)
file(GLOB_RECURSE EXECUTABLE_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
set(EXECUTABLE_SRCS
CliRunnable.cpp
CliRunnable.h
MaNGOSsoap.cpp
MaNGOSsoap.h
Main.cpp
Master.cpp
Master.h
RASocket.cpp
RASocket.h
WorldRunnable.cpp
WorldRunnable.h
soapC.cpp
soapH.h
soapServer.cpp
soapStub.h
)
if(WIN32) if(WIN32)
list(APPEND EXECUTABLE_SRCS # add resource file to windows build
mangosd.rc set(EXECUTABLE_SRCS ${EXECUTABLE_SRCS} mangosd.rc)
)
endif() endif()
include_directories( include_directories(

View file

@ -17,12 +17,23 @@
# #
set(EXECUTABLE_NAME realmd) set(EXECUTABLE_NAME realmd)
file(GLOB_RECURSE EXECUTABLE_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
set(EXECUTABLE_SRCS
AuthCodes.h
AuthSocket.cpp
AuthSocket.h
BufferedSocket.cpp
BufferedSocket.h
Main.cpp
PatchHandler.cpp
PatchHandler.h
RealmList.cpp
RealmList.h
)
if(WIN32) if(WIN32)
list(APPEND EXECUTABLE_SRCS # add resource file to windows build
realmd.rc set(EXECUTABLE_SRCS ${EXECUTABLE_SRCS} realmd.rc)
)
endif() endif()
include_directories( include_directories(

View file

@ -16,29 +16,97 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# Glob only and not recurse, there are other libs for that set(LIBRARY_NAME shared)
file(GLOB_RECURSE shared_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
# Exclude Win32 files set(LIBRARY_SRCS
Auth/AuthCrypt.cpp
Auth/AuthCrypt.h
Auth/BigNumber.cpp
Auth/BigNumber.h
Auth/HMACSHA1.cpp
Auth/HMACSHA1.h
Auth/md5.h
Auth/SARC4.cpp
Auth/SARC4.h
Auth/Sha1.cpp
Auth/Sha1.h
ByteBuffer.cpp
ByteBuffer.h
Common.cpp
Common.h
Config/Config.cpp
Config/Config.h
Database/Database.cpp
Database/Database.h
Database/DatabaseEnv.h
Database/DatabaseImpl.h
Database/DatabaseMysql.cpp
Database/DatabaseMysql.h
Database/DatabasePostgre.cpp
Database/DatabasePostgre.h
Database/DB2FileLoader.cpp
Database/DB2FileLoader.h
Database/DB2Store.h
Database/DBCFileLoader.cpp
Database/DBCFileLoader.h
Database/DBCStore.h
Database/Field.cpp
Database/Field.h
Database/PGSQLDelayThread.h
Database/QueryResult.h
Database/QueryResultMysql.cpp
Database/QueryResultMysql.h
Database/QueryResultPostgre.cpp
Database/QueryResultPostgre.h
Database/SqlDelayThread.cpp
Database/SqlDelayThread.h
Database/SqlOperations.cpp
Database/SqlOperations.h
Database/SqlPreparedStatement.cpp
Database/SqlPreparedStatement.h
Database/SQLStorage.cpp
Database/SQLStorage.h
Database/SQLStorageImpl.h
Errors.h
LockedQueue.h
Log.cpp
Log.h
ProgressBar.cpp
ProgressBar.h
revision_nr.h
revision_sql.h
SystemConfig.h
Threading.cpp
Threading.h
Timer.h
Util.cpp
Util.h
WorldPacket.h
)
# OS specific files
if(WIN32) if(WIN32)
list(REMOVE_ITEM shared_SRCS set(LIBRARY_SRCS
PosixDaemon.h ${LIBRARY_SRCS}
PosixDaemon.cpp WheatyExceptionReport.cpp
) WheatyExceptionReport.h
ServiceWin32.cpp
ServiceWin32.h
)
else() else()
list(REMOVE_ITEM shared_SRCS set(LIBRARY_SRCS
WheatyExceptionReport.cpp ${LIBRARY_SRCS}
WheatyExceptionReport.h PosixDaemon.cpp
ServiceWin32.cpp PosixDaemon.h
ServiceWin32.h )
)
endif() endif()
source_group("Util" source_group("Util"
REGULAR_EXPRESSION .* REGULAR_EXPRESSION .*
) )
foreach(SRC ${shared_SRCS}) # TODO: really needed?
foreach(SRC ${LIBRARY_SRCS})
get_filename_component(PTH ${SRC} PATH) get_filename_component(PTH ${SRC} PATH)
if(PTH) if(PTH)
if(NOT XCODE) # FIXME: Xcode Generator has bug with nested dirs if(NOT XCODE) # FIXME: Xcode Generator has bug with nested dirs
@ -67,12 +135,11 @@ include_directories(
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SystemConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SystemConfig.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SystemConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SystemConfig.h)
add_library(shared STATIC add_library(${LIBRARY_NAME} STATIC
${shared_SRCS} ${LIBRARY_SRCS}
) )
add_dependencies(shared revision.h) add_dependencies(${LIBRARY_NAME} revision.h)
if(NOT ACE_USE_EXTERNAL) if(NOT ACE_USE_EXTERNAL)
add_dependencies(shared ACE_Project) add_dependencies(${LIBRARY_NAME} ACE_Project)
# add_dependencies(shared ace)
endif() endif()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12537" #define REVISION_NR "12538"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__