mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
feat(Core/Modules): add separated lib for modules (#9281)
This commit is contained in:
@@ -51,17 +51,17 @@ function(CopyModuleConfig configDir)
|
||||
|
||||
if(WIN32)
|
||||
if("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
|
||||
add_custom_command(TARGET worldserver
|
||||
add_custom_command(TARGET modules
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/${postPath}")
|
||||
add_custom_command(TARGET worldserver
|
||||
add_custom_command(TARGET modules
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${configDir}" "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/${postPath}")
|
||||
elseif(MINGW)
|
||||
add_custom_command(TARGET worldserver
|
||||
add_custom_command(TARGET modules
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${postPath}")
|
||||
add_custom_command(TARGET worldserver
|
||||
add_custom_command(TARGET modules
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${configDir} ${CMAKE_BINARY_DIR}/bin/${postPath}")
|
||||
endif()
|
||||
@@ -74,35 +74,3 @@ function(CopyModuleConfig configDir)
|
||||
endif()
|
||||
unset(postPath)
|
||||
endfunction()
|
||||
|
||||
# Stores the absolut path of the given config module in the variable
|
||||
function(GetPathToModuleConfig module variable)
|
||||
set(${variable} "${CMAKE_SOURCE_DIR}/modules/${module}/conf" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Creates a list of all configs modules
|
||||
# and stores it in the given variable.
|
||||
function(CollectModulesConfig)
|
||||
file(GLOB LOCALE_MODULE_LIST RELATIVE
|
||||
${CMAKE_SOURCE_DIR}/modules
|
||||
${CMAKE_SOURCE_DIR}/modules/*)
|
||||
|
||||
message(STATUS "* Modules config list:")
|
||||
|
||||
foreach(CONFIG_MODULE ${LOCALE_MODULE_LIST})
|
||||
GetPathToModuleConfig(${CONFIG_MODULE} MODULE_CONFIG_PATH)
|
||||
|
||||
file(GLOB MODULE_CONFIG_LIST RELATIVE
|
||||
${MODULE_CONFIG_PATH}
|
||||
${MODULE_CONFIG_PATH}/*.conf.dist)
|
||||
|
||||
foreach(configFileName ${MODULE_CONFIG_LIST})
|
||||
CopyModuleConfig("${MODULE_CONFIG_PATH}/${configFileName}")
|
||||
set(CONFIG_LIST ${CONFIG_LIST}${configFileName},)
|
||||
message(STATUS " |- ${configFileName}")
|
||||
endforeach()
|
||||
|
||||
endforeach()
|
||||
message("")
|
||||
add_definitions(-DCONFIG_FILE_LIST=$<1:"${CONFIG_LIST}">)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user