CMake: Use inherited dependencies in worldserver and authserver

This commit is contained in:
Aokromes committed 2016-08-10 01:00:17 +02:00
1 parent 7ef9b246b5
commit 08341818f6
2 files changed
+69 -195

No files matched your search

+34 -64
View File
@@ -10,69 +10,29 @@
########### authserver ############### ########### authserver ###############
file(GLOB_RECURSE sources_authentication Authentication/*.cpp Authentication/*.h) CollectSourceFiles(
file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h) ${CMAKE_CURRENT_SOURCE_DIR}
file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h) PRIVATE_SOURCES
file(GLOB sources_localdir *.cpp *.h) # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH)
set(authserver_PCH_HDR PrecompiledHeaders/authPCH.h)
set(authserver_PCH_SRC PrecompiledHeaders/authPCH.cpp)
endif()
set(authserver_SRCS
${authserver_SRCS}
${sources_authentication}
${sources_realms}
${sources_server}
${sources_localdir}
)
if( WIN32 ) if( WIN32 )
set(authserver_SRCS list(APPEND PRIVATE_SOURCES ${sources_windows})
${authserver_SRCS}
${sources_windows}
)
if ( MSVC ) if ( MSVC )
set(authserver_SRCS list(APPEND PRIVATE_SOURCES authserver.rc)
${authserver_SRCS} endif()
authserver.rc
)
endif ()
endif() endif()
include_directories( if (USE_COREPCH)
${CMAKE_BINARY_DIR} set(PRIVATE_PCH_HEADER PrecompiledHeaders/authPCH.h)
${CMAKE_CURRENT_SOURCE_DIR}/Authentication set(PRIVATE_PCH_SOURCE PrecompiledHeaders/authPCH.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/Realms endif()
${CMAKE_CURRENT_SOURCE_DIR}/Server
${CMAKE_SOURCE_DIR}/dep/cppformat
${CMAKE_SOURCE_DIR}/src/common/
${CMAKE_SOURCE_DIR}/src/common/Configuration
${CMAKE_SOURCE_DIR}/src/common/Cryptography
${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/common/Platform
${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/Networking
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
${CMAKE_SOURCE_DIR}/src/server/shared/Service
${MYSQL_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${VALGRIND_INCLUDE_DIR}
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(authserver add_executable(authserver
${authserver_SRCS} ${PRIVATE_SOURCES}
${authserver_PCH_SRC} ${PRIVATE_PCH_SOURCE}
) )
if( NOT WIN32 ) if( NOT WIN32 )
@@ -82,15 +42,25 @@ if( NOT WIN32 )
endif() endif()
target_link_libraries(authserver target_link_libraries(authserver
shared PUBLIC
database shared)
common
cppformat CollectIncludeDirectories(
${MYSQL_LIBRARY} ${CMAKE_CURRENT_SOURCE_DIR}
${OPENSSL_LIBRARIES} PUBLIC_INCLUDES
${CMAKE_THREAD_LIBS_INIT} # Exclude
${Boost_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
)
target_include_directories(authserver
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(authserver
PROPERTIES
FOLDER
"server")
if( WIN32 ) if( WIN32 )
if ( MSVC ) if ( MSVC )
@@ -116,5 +86,5 @@ endif()
# Generate precompiled header # Generate precompiled header
if (USE_COREPCH) if (USE_COREPCH)
add_cxx_pch(authserver ${authserver_PCH_HDR} ${authserver_PCH_SRC}) add_cxx_pch(authserver ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif() endif()
+35 -131
View File
@@ -8,125 +8,29 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
file(GLOB_RECURSE sources_CommandLine CommandLine/*.cpp CommandLine/*.h) CollectSourceFiles(
file(GLOB_RECURSE sources_RemoteAccess RemoteAccess/*.cpp RemoteAccess/*.h) ${CMAKE_CURRENT_SOURCE_DIR}
file(GLOB_RECURSE sources_TCSoap TCSoap/*.cpp TCSoap/*.h) PRIVATE_SOURCES
file(GLOB sources_localdir *.cpp *.h) # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH)
set(worldserver_PCH_HDR PrecompiledHeaders/worldPCH.h)
set(worldserver_PCH_SRC PrecompiledHeaders/worldPCH.cpp)
endif()
set(worldserver_SRCS
${worldserver_SRCS}
${sources_CommandLine}
${sources_RemoteAccess}
${sources_TCSoap}
${sources_localdir}
)
if( WIN32 ) if( WIN32 )
set(worldserver_SRCS list(APPEND PRIVATE_SOURCES ${sources_windows})
${worldserver_SRCS}
${sources_windows}
)
if ( MSVC ) if ( MSVC )
set(worldserver_SRCS list(APPEND PRIVATE_SOURCES worldserver.rc)
${worldserver_SRCS}
worldserver.rc
)
endif() endif()
endif() endif()
include_directories( if (USE_COREPCH)
${CMAKE_BINARY_DIR} set(PRIVATE_PCH_HEADER PrecompiledHeaders/worldPCH.h)
${CMAKE_CURRENT_SOURCE_DIR}/CommandLine set(PRIVATE_PCH_SOURCE PrecompiledHeaders/worldPCH.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/RemoteAccess endif()
${CMAKE_CURRENT_SOURCE_DIR}/TCSoap
${CMAKE_SOURCE_DIR}/dep/cppformat
${CMAKE_SOURCE_DIR}/dep/g3dlite/include
${CMAKE_SOURCE_DIR}/dep/gsoap
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
${CMAKE_SOURCE_DIR}/dep/zmqpp
${CMAKE_SOURCE_DIR}/src/common/
${CMAKE_SOURCE_DIR}/src/common/Collision
${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/Cryptography
${CMAKE_SOURCE_DIR}/src/common/Cryptography/Authentication
${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/common/Platform
${CMAKE_SOURCE_DIR}/src/server/authserver/Realms
${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/ipc
${CMAKE_SOURCE_DIR}/src/server/game
${CMAKE_SOURCE_DIR}/src/server/game/Accounts
${CMAKE_SOURCE_DIR}/src/server/game/Addons
${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds
${CMAKE_SOURCE_DIR}/src/server/game/Chat
${CMAKE_SOURCE_DIR}/src/server/game/Combat
${CMAKE_SOURCE_DIR}/src/server/game/Conditions
${CMAKE_SOURCE_DIR}/src/server/game/DataStores
${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/GameObject
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container
${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/Unit
${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle
${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/Groups
${CMAKE_SOURCE_DIR}/src/server/game/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Instances
${CMAKE_SOURCE_DIR}/src/server/game/Loot
${CMAKE_SOURCE_DIR}/src/server/game/Mails
${CMAKE_SOURCE_DIR}/src/server/game/Maps
${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous
${CMAKE_SOURCE_DIR}/src/server/game/Movement
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline
${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints
${CMAKE_SOURCE_DIR}/src/server/game/Quests
${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/Spells
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
${CMAKE_SOURCE_DIR}/src/server/game/Weather
${CMAKE_SOURCE_DIR}/src/server/game/World
${CMAKE_SOURCE_DIR}/src/server/shared
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Networking
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
${CMAKE_SOURCE_DIR}/src/server/shared/Service
${MYSQL_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${VALGRIND_INCLUDE_DIR}
${ZMQ_INCLUDE_DIR}
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(worldserver add_executable(worldserver
${worldserver_SRCS} ${PRIVATE_SOURCES}
${worldserver_PCH_SRC} ${PRIVATE_PCH_SOURCE}
) )
if( NOT WIN32 ) if( NOT WIN32 )
@@ -142,27 +46,27 @@ endif()
set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}") set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}")
target_link_libraries(worldserver target_link_libraries(worldserver
game PUBLIC
scripts scripts
ipc gsoap
shared readline)
database
common CollectIncludeDirectories(
g3dlib ${CMAKE_CURRENT_SOURCE_DIR}
gsoap PUBLIC_INCLUDES
Detour # Exclude
zmqpp ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
cppformat
${JEMALLOC_LIBRARY} target_include_directories(worldserver
${READLINE_LIBRARY} PUBLIC
${TERMCAP_LIBRARY} ${PUBLIC_INCLUDES}
${MYSQL_LIBRARY} PRIVATE
${OPENSSL_LIBRARIES} ${CMAKE_CURRENT_BINARY_DIR})
${ZLIB_LIBRARIES}
${ZMQ_LIBRARY} set_target_properties(worldserver
${CMAKE_THREAD_LIBS_INIT} PROPERTIES
${Boost_LIBRARIES} FOLDER
) "server")
if( WIN32 ) if( WIN32 )
if ( MSVC ) if ( MSVC )
@@ -188,5 +92,5 @@ endif()
# Generate precompiled header # Generate precompiled header
if( USE_COREPCH ) if( USE_COREPCH )
add_cxx_pch(worldserver ${worldserver_PCH_HDR} ${worldserver_PCH_SRC}) add_cxx_pch(worldserver ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif() endif()