diff --git a/CMakeLists.txt b/CMakeLists.txt index 76aac48f1a..78aa8700dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,6 +443,25 @@ if(MSVC) endif() endif() +if(BUILD_ELUNA) + set_property(TARGET game shared mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA CMANGOS TBC ELUNA_CMANGOS ELUNA_EXPANSION=1) + set_property(TARGET game mangosd APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks) + 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 TBC ELUNA_CMANGOS ELUNA_EXPANSION=1) + set_property(TARGET playerbots APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks) + set_property(TARGET playerbots APPEND PROPERTY LINK_LIBRARIES ${LIBRARY_NAME} PRIVATE lualib) + endif() +endif() + +if(BUILD_SOLOCRAFT) + set_property(TARGET game mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_SOLOCRAFT) + if(BUILD_PLAYERBOTS) + set_property(TARGET playerbots APPEND PROPERTY COMPILE_DEFINITIONS BUILD_SOLOCRAFT) + endif() +endif() + # if(SQL) # add_subdirectory(sql) # endif() diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 48cf2ebdad..965fbfcda3 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -79,11 +79,6 @@ foreach (TMP_PATH ${LIBRARY_SRCS}) list(REMOVE_ITEM LIBRARY_SRCS ${TMP_PATH}) endif () endforeach() -add_definitions(-DBUILD_ELUNA -DCMANGOS -DTBC) -endif() - -if(BUILD_SOLOCRAFT) -add_definitions(-DBUILD_SOLOCRAFT) endif() if(NOT BUILD_DEPRECATED_PLAYERBOT) diff --git a/src/mangosd/CMakeLists.txt b/src/mangosd/CMakeLists.txt index 03f90ff320..f4266e8801 100644 --- a/src/mangosd/CMakeLists.txt +++ b/src/mangosd/CMakeLists.txt @@ -163,16 +163,10 @@ if (BUILD_ELUNA) include_directories( ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks ) - add_definitions(-DBUILD_ELUNA -DTBC -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() -# Define BUILD_SOLOCRAFT if needed -if (BUILD_SOLOCRAFT) -add_definitions(-DBUILD_SOLOCRAFT) -endif() - if(MSVC) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/\${BUILD_TYPE}/${EXECUTABLE_NAME}.pdb DESTINATION ${BIN_DIR} CONFIGURATIONS Debug) endif() diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 2ac4180a8e..5058c8c6c1 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -271,11 +271,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 -DTBC -DCMANGOS) -endif() - # Mark the revision header as being generated. set_source_files_properties(${CMAKE_BINARY_DIR}/src/shared/revision.h PROPERTIES GENERATED TRUE