From bfe39a919e6691503ad397fc28655556800ad9be Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 21:13:47 +0100 Subject: [PATCH] fix: more include changes --- CMakeLists.txt | 11 ----------- dGame/CMakeLists.txt | 2 ++ dGame/dBehaviors/CMakeLists.txt | 9 ++++++++- dGame/dComponents/CMakeLists.txt | 11 ++++++++++- dGame/dGameMessages/CMakeLists.txt | 15 ++++++++++++++- dGame/dInventory/CMakeLists.txt | 10 ++++++++++ dGame/dMission/CMakeLists.txt | 9 +++++++++ dGame/dPropertyBehaviors/CMakeLists.txt | 5 +++++ dGame/dUtilities/CMakeLists.txt | 9 +++++++++ dNavigation/CMakeLists.txt | 3 ++- dNet/CMakeLists.txt | 8 ++++++-- dScripts/CMakeLists.txt | 14 ++++++++++---- dWorldServer/CMakeLists.txt | 6 +++--- dZoneManager/CMakeLists.txt | 10 ++++++++++ tests/dCommonTests/CMakeLists.txt | 2 +- 15 files changed, 99 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00c12e28..5d35769b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,17 +209,6 @@ set(INCLUDED_DIRECTORIES "dChatFilter" - "dGame" - "dGame/dBehaviors" - "dGame/dComponents" - "dGame/dGameMessages" - "dGame/dInventory" - "dGame/dMission" - "dGame/dEntity" - "dGame/dPropertyBehaviors" - "dGame/dPropertyBehaviors/ControlBehaviorMessages" - "dGame/dUtilities" - "dPhysics" "dNavigation" diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index ac7f38cc..541536d4 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -15,6 +15,8 @@ include_directories( add_library(dGameBase ${DGAME_SOURCES}) target_precompile_headers(dGameBase PRIVATE ${HEADERS_DGAME}) +target_include_directories(dGameBase PUBLIC "." "dEntity" + PRIVATE "dComponents" "dGameMessages" "dBehaviors" "dMission" "dUtilities" "dInventory") target_link_libraries(dGameBase PUBLIC dDatabase dPhysics INTERFACE dComponents dEntity) diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index c8cb0be0..aa8aa5f7 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -58,5 +58,12 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp" add_library(dBehaviors STATIC ${DGAME_DBEHAVIORS_SOURCES}) target_link_libraries(dBehaviors PUBLIC dPhysics) -target_include_directories(dBehaviors PUBLIC ".") +target_include_directories(dBehaviors PUBLIC "." + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via BehaviorContext.h + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct BuffComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # Preconditions.h via QuickBuildComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager.h, Spawner.h + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via CharacterComponent.h +) target_precompile_headers(dBehaviors REUSE_FROM dGameBase) diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index b14d0eb8..810cc74f 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -50,7 +50,16 @@ set(DGAME_DCOMPONENTS_SOURCES ) add_library(dComponents STATIC ${DGAME_DCOMPONENTS_SOURCES}) -target_include_directories(dComponents PRIVATE ${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General) # PetDigServer.h +target_include_directories(dComponents PUBLIC "." + "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h + PRIVATE + "${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General" # PetDigServer.h + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct Loot.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h +) target_precompile_headers(dComponents REUSE_FROM dGameBase) target_link_libraries(dComponents PUBLIC dPhysics dDatabase diff --git a/dGame/dGameMessages/CMakeLists.txt b/dGame/dGameMessages/CMakeLists.txt index 7373633c..c7d5b3fb 100644 --- a/dGame/dGameMessages/CMakeLists.txt +++ b/dGame/dGameMessages/CMakeLists.txt @@ -5,5 +5,18 @@ set(DGAME_DGAMEMESSAGES_SOURCES "PropertySelectQueryProperty.cpp") add_library(dGameMessages STATIC ${DGAME_DGAMEMESSAGES_SOURCES}) -target_link_libraries(dGameMessages PUBLIC dDatabase) +target_link_libraries(dGameMessages + PUBLIC dDatabase + INTERFACE dGameBase # TradingManager +) +target_include_directories(dGameMessages PUBLIC "." + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct MissionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct SlashCommandHandler.h + "${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors" # direct ControlBehaviors.h + "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h +) target_precompile_headers(dGameMessages REUSE_FROM dGameBase) diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index a663a97d..f5dd2592 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -6,4 +6,14 @@ set(DGAME_DINVENTORY_SOURCES "ItemSetPassiveAbility.cpp") add_library(dInventory STATIC ${DGAME_DINVENTORY_SOURCES}) +target_include_directories(dInventory PUBLIC "." + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # Item.h uses Preconditions.h + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct + "${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h + "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h +) +target_link_libraries(dInventory INTERFACE dNet) target_precompile_headers(dInventory REUSE_FROM dGameBase) diff --git a/dGame/dMission/CMakeLists.txt b/dGame/dMission/CMakeLists.txt index 4e4bdec2..fa3fcc9b 100644 --- a/dGame/dMission/CMakeLists.txt +++ b/dGame/dMission/CMakeLists.txt @@ -5,4 +5,13 @@ set(DGAME_DMISSION_SOURCES add_library(dMission STATIC ${DGAME_DMISSION_SOURCES}) target_link_libraries(dMission PUBLIC dDatabase) +target_include_directories(dMission PUBLIC "." + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dComponents" + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via CharacterComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # via CharacterComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via LevelProgressionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h +) target_precompile_headers(dMission REUSE_FROM dGameBase) diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 47c8ff23..618e57fc 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -13,4 +13,9 @@ foreach(file ${DGAME_DPROPERTYBEHAVIORS_CONTROLBEHAVIORMESSAGES}) endforeach() add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) +target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages" + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # GameMessages.h + "${PROJECT_SOURCE_DIR}/dGame/dComponents" # ModelComponent.h +) target_precompile_headers(dPropertyBehaviors REUSE_FROM dGameBase) diff --git a/dGame/dUtilities/CMakeLists.txt b/dGame/dUtilities/CMakeLists.txt index 055cc706..6d26cd5a 100644 --- a/dGame/dUtilities/CMakeLists.txt +++ b/dGame/dUtilities/CMakeLists.txt @@ -10,6 +10,15 @@ set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp" add_library(dUtilities STATIC ${DGAME_DUTILITIES_SOURCES}) target_precompile_headers(dUtilities REUSE_FROM dGameBase) +target_include_directories(dUtilities PUBLIC "." + PRIVATE + "${PROJECT_SOURCE_DIR}/dGame/dComponents" + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # transitive via PossessableComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # transitive via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dMission" # transitive via MissionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # transitive via dZoneManager/Spawner.h +) target_link_libraries(dUtilities PUBLIC dDatabase dPhysics INTERFACE dZoneManager) diff --git a/dNavigation/CMakeLists.txt b/dNavigation/CMakeLists.txt index 4c03d24b..d619631a 100644 --- a/dNavigation/CMakeLists.txt +++ b/dNavigation/CMakeLists.txt @@ -7,4 +7,5 @@ foreach(file ${DNAVIGATIONS_DTERRAIN_SOURCES}) endforeach() add_library(dNavigation STATIC ${DNAVIGATION_SOURCES}) -target_link_libraries(dNavigation Detour Recast) +target_link_libraries(dNavigation + PRIVATE Detour Recast dZoneManager) diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index b4b77c82..bd22434c 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -9,9 +9,13 @@ set(DNET_SOURCES "AuthPackets.cpp" add_library(dNet STATIC ${DNET_SOURCES}) target_include_directories(dNet PRIVATE + ${PROJECT_SOURCE_DIR}/dGame # UserManager.h ${PROJECT_SOURCE_DIR}/dGame/dComponents + ${PROJECT_SOURCE_DIR}/dGame/dGameMessages # GameMessages.h + ${PROJECT_SOURCE_DIR}/dGame/dInventory # via PossessableComponent.h + ${PROJECT_SOURCE_DIR}/dGame/dUtilities # via Item.h ${PROJECT_SOURCE_DIR}/dScripts # transitive through components ) target_link_libraries(dNet - PUBLIC dCommon dDatabase - INTERFACE dZoneManager) + PUBLIC dCommon dDatabase + PRIVATE dZoneManager) diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index b3fb7d44..58836962 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -19,13 +19,19 @@ link_libraries(dDatabase dPhysics) add_library(dScriptsBase STATIC ${DSCRIPTS_SOURCES}) target_include_directories(dScriptsBase PUBLIC .) -target_link_libraries(dScriptsBase - INTERFACE dGameBase) +target_link_libraries(dScriptsBase INTERFACE dGameBase) target_precompile_headers(dScriptsBase PRIVATE ${HEADERS_DGAME}) include_directories( - ${PROJECT_SOURCE_DIR}/dScripts - ${PROJECT_SOURCE_DIR}/dGame + "${PROJECT_SOURCE_DIR}/dScripts" + "${PROJECT_SOURCE_DIR}/dGame" + "${PROJECT_SOURCE_DIR}/dGame/dComponents" # e.g. ScriptedActivityComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # e.g. direct ActivityManager + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # e.g. direct ActivityManager + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager.h + "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # viaInventoryComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h ) link_libraries(dScriptsBase) # dComponents diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 336a60f9..2deb0635 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -3,9 +3,9 @@ set(DWORLDSERVER_SOURCES ) add_library(dWorldServer ${DWORLDSERVER_SOURCES}) +target_link_libraries(dWorldServer PRIVATE dGame) # ${COMMON_LIBRARIES} + add_executable(WorldServer "WorldServer.cpp") add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") -target_link_libraries(dWorldServer ${COMMON_LIBRARIES}) -target_link_libraries(WorldServer ${COMMON_LIBRARIES} dChatFilter dGame dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) - +target_link_libraries(WorldServer ${COMMON_LIBRARIES} dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) \ No newline at end of file diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index e7382367..d1e6c0dd 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -7,3 +7,13 @@ add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES}) target_link_libraries(dZoneManager PUBLIC dPhysics INTERFACE dWorldServer) +target_include_directories(dZoneManager PUBLIC + ${PROJECT_SOURCE_DIR}/dGame # Entity.h + ${PROJECT_SOURCE_DIR}/dGame/dEntity # EntityInfo.h + PRIVATE + ${PROJECT_SOURCE_DIR}/dGame/dComponents #InventoryComponent.h + ${PROJECT_SOURCE_DIR}/dGame/dInventory #InventoryComponent.h (transitive) + ${PROJECT_SOURCE_DIR}/dGame/dBehaviors #BehaviorSlot.h + ${PROJECT_SOURCE_DIR}/dGame/dGameMessages #GameMessages.h + ${PROJECT_SOURCE_DIR}/dGame/dUtilities #VanityUtilities.h +) \ No newline at end of file diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index be23d866..8d95e220 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -19,7 +19,7 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) # Link needed libraries -target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) +target_link_libraries(dCommonTests ${COMMON_LIBRARIES} dGame GTest::gtest_main) # Copy test files to testing directory add_subdirectory(TestBitStreams)