diff --git a/CMakeLists.txt b/CMakeLists.txt index 9465c48c2..6d760155a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,6 +427,21 @@ if(MSVC) endif() endif() +if(BUILD_ELUNA) + set_property(TARGET game shared mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA ELUNA_CMANGOS ELUNA_EXPANSION=3) + set_property(TARGET game mangosd APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks) + set_property(TARGET game APPEND PROPERTY INCLUDE_DIRECTORIES + ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/ + ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/methods/CMangos + ${CMAKE_SOURCE_DIR}/dep/lualib + ) + set_property(TARGET game APPEND PROPERTY LINK_LIBRARIES ${LIBRARY_NAME} PRIVATE lualib) + set_property(TARGET mangosd APPEND PROPERTY LINK_LIBRARIES ${EXECUTABLE_NAME} lualib) + if(BUILD_PLAYERBOTS) + set_property(TARGET playerbots APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA ELUNA_CMANGOS ELUNA_EXPANSION=3) + endif() +endif() + # if(SQL) # add_subdirectory(sql) # endif() diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index c213557dc..34952b73b 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -74,7 +74,6 @@ foreach (TMP_PATH ${LIBRARY_SRCS}) list(REMOVE_ITEM LIBRARY_SRCS ${TMP_PATH}) endif () endforeach() -add_definitions(-DBUILD_ELUNA -DCMANGOS -DCATA) endif() if(NOT BUILD_DEPRECATED_PLAYERBOT) @@ -118,7 +117,6 @@ target_link_libraries(${LIBRARY_NAME} PRIVATE g3dlite PRIVATE detour PRIVATE zlib - PRIVATE lualib ) # include additionals headers @@ -129,10 +127,6 @@ set(ADDITIONAL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/BattleGround ${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP ${CMAKE_CURRENT_SOURCE_DIR}/PlayerBot - ${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/ - ${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/methods/CMangos - ${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/hooks - ${CMAKE_SOURCE_DIR}/dep/lualib ${CMAKE_BINARY_DIR} ) @@ -154,11 +148,6 @@ if (BUILD_SCRIPTDEV) add_definitions(-DBUILD_SCRIPTDEV) endif() -# Define BUILD_ELUNA if need -if (BUILD_ELUNA) - add_definitions(-DBUILD_ELUNA) -endif() - # Define BUILD_AHBOT if need if (BUILD_AHBOT) add_definitions(-DBUILD_AHBOT) diff --git a/src/mangosd/CMakeLists.txt b/src/mangosd/CMakeLists.txt index c26b1c2d6..0772473bc 100644 --- a/src/mangosd/CMakeLists.txt +++ b/src/mangosd/CMakeLists.txt @@ -60,7 +60,6 @@ target_link_libraries(${EXECUTABLE_NAME} shared game gsoap - lualib ) if(WIN32) @@ -143,10 +142,6 @@ endif() # Define BUILD_ELUNA if needed if (BUILD_ELUNA) - include_directories( - ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks - ) - add_definitions(-DBUILD_ELUNA -DCATA -DCMANGOS) install(FILES ${CMAKE_SOURCE_DIR}/contrib/lua_scripts/masterscript.lua DESTINATION ${BIN_DIR}/lua_scripts) install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/extensions DESTINATION ${BIN_DIR}/lua_scripts) endif() diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 94f9cdb6b..7483b84ec 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -268,11 +268,6 @@ if(PCH) target_precompile_headers(${LIBRARY_NAME} PRIVATE "${PCH_FILE_HEADER}") endif() -# Define BUILD_ELUNA if needed -if (BUILD_ELUNA) - add_definitions(-DBUILD_ELUNA -DCATA -DCMANGOS) -endif() - # Mark the revision header as being generated. set_source_files_properties(${CMAKE_BINARY_DIR}/src/shared/revision.h PROPERTIES GENERATED TRUE