From c81ac4e4469baa5d0db516ff2ce1ac4676d91bdc Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 00:59:41 +0100 Subject: [PATCH] fix: split apart big Cmake libraries --- CMakeLists.txt | 78 ------------------ dGame/CMakeLists.txt | 59 ++++--------- dGame/dBehaviors/CMakeLists.txt | 7 +- dGame/dComponents/CMakeLists.txt | 11 ++- dGame/dEntity/CMakeLists.txt | 8 +- dGame/dGameMessages/CMakeLists.txt | 9 +- dGame/dInventory/CMakeLists.txt | 8 +- dGame/dMission/CMakeLists.txt | 9 +- dGame/dPropertyBehaviors/CMakeLists.txt | 3 +- dGame/dUtilities/CMakeLists.txt | 8 +- dNet/CMakeLists.txt | 8 +- dPhysics/CMakeLists.txt | 4 +- dScripts/02_server/CMakeLists.txt | 25 +++--- dScripts/02_server/Enemy/CMakeLists.txt | 13 ++- dScripts/02_server/Map/AG/CMakeLists.txt | 7 +- .../Map/AG_Spider_Queen/CMakeLists.txt | 8 +- dScripts/02_server/Map/AM/CMakeLists.txt | 7 +- dScripts/02_server/Map/CMakeLists.txt | 82 ++++--------------- dScripts/02_server/Map/FV/CMakeLists.txt | 4 +- dScripts/02_server/Map/GF/CMakeLists.txt | 7 +- dScripts/02_server/Map/General/CMakeLists.txt | 5 +- dScripts/02_server/Map/NS/CMakeLists.txt | 4 +- dScripts/02_server/Map/NT/CMakeLists.txt | 7 +- dScripts/02_server/Map/PR/CMakeLists.txt | 7 +- .../02_server/Map/Property/CMakeLists.txt | 7 +- dScripts/02_server/Map/SS/CMakeLists.txt | 7 +- dScripts/02_server/Map/VE/CMakeLists.txt | 7 +- dScripts/02_server/Map/njhub/CMakeLists.txt | 9 +- dScripts/02_server/Pets/CMakeLists.txt | 8 +- dScripts/CMakeLists.txt | 56 ++++++------- dScripts/EquipmentScripts/CMakeLists.txt | 7 +- dScripts/EquipmentTriggers/CMakeLists.txt | 7 +- .../Map/General => }/InvalidScript.cpp | 0 .../Map/General => }/InvalidScript.h | 0 dScripts/ai/ACT/CMakeLists.txt | 4 +- dScripts/ai/AG/CMakeLists.txt | 7 +- dScripts/ai/CMakeLists.txt | 81 ++++-------------- dScripts/ai/FV/CMakeLists.txt | 8 +- dScripts/ai/GENERAL/CMakeLists.txt | 8 +- dScripts/ai/GF/CMakeLists.txt | 7 +- dScripts/ai/MINIGAME/CMakeLists.txt | 4 +- dScripts/ai/NP/CMakeLists.txt | 7 +- dScripts/ai/NS/CMakeLists.txt | 6 +- dScripts/ai/PETS/CMakeLists.txt | 7 +- dScripts/ai/PROPERTY/CMakeLists.txt | 4 +- dScripts/ai/RACING/CMakeLists.txt | 4 +- dScripts/ai/SPEC/CMakeLists.txt | 7 +- dScripts/ai/WILD/CMakeLists.txt | 7 +- dScripts/client/CMakeLists.txt | 4 +- dScripts/zone/CMakeLists.txt | 10 ++- dZoneManager/CMakeLists.txt | 4 +- 51 files changed, 309 insertions(+), 366 deletions(-) rename dScripts/{02_server/Map/General => }/InvalidScript.cpp (100%) rename dScripts/{02_server/Map/General => }/InvalidScript.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d47c5953..90fa5b043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,78 +215,6 @@ set(INCLUDED_DIRECTORIES "dNet" - "dScripts" - "dScripts/02_server" - "dScripts/ai" - "dScripts/client" - "dScripts/EquipmentScripts" - "dScripts/EquipmentTriggers" - "dScripts/zone" - "dScripts/02_server/DLU" - "dScripts/02_server/Enemy" - "dScripts/02_server/Equipment" - "dScripts/02_server/Map" - "dScripts/02_server/Minigame" - "dScripts/02_server/Objects" - "dScripts/02_server/Pets" - "dScripts/02_server/Enemy/AG" - "dScripts/02_server/Enemy/AM" - "dScripts/02_server/Enemy/FV" - "dScripts/02_server/Enemy/General" - "dScripts/02_server/Enemy/Survival" - "dScripts/02_server/Enemy/VE" - "dScripts/02_server/Enemy/Waves" - "dScripts/02_server/Map/AG" - "dScripts/02_server/Map/AG_Spider_Queen" - "dScripts/02_server/Map/AM" - "dScripts/02_server/Map/FV" - "dScripts/02_server/Map/General" - "dScripts/02_server/Map/GF" - "dScripts/02_server/Map/njhub" - "dScripts/02_server/Map/NS" - "dScripts/02_server/Map/NT" - "dScripts/02_server/Map/PR" - "dScripts/02_server/Map/Property" - "dScripts/02_server/Map/SS" - "dScripts/02_server/Map/VE" - "dScripts/02_server/Map/FV/Racing" - "dScripts/02_server/Map/General/Ninjago" - "dScripts/02_server/Map/njhub/boss_instance" - "dScripts/02_server/Map/NS/Waves" - "dScripts/02_server/Map/Property/AG_Med" - "dScripts/02_server/Map/Property/AG_Small" - "dScripts/02_server/Map/Property/NS_Med" - "dScripts/02_server/Minigame/General" - "dScripts/ai/ACT" - "dScripts/ai/AG" - "dScripts/ai/FV" - "dScripts/ai/GENERAL" - "dScripts/ai/GF" - "dScripts/ai/MINIGAME" - "dScripts/ai/MINIGAME/Objects" - "dScripts/ai/NP" - "dScripts/ai/NS" - "dScripts/ai/PETS" - "dScripts/ai/PROPERTY" - "dScripts/ai/RACING" - "dScripts/ai/SPEC" - "dScripts/ai/WILD" - "dScripts/ai/ACT/FootRace" - "dScripts/ai/MINIGAME/SG_GF" - "dScripts/ai/MINIGAME/SG_GF/SERVER" - "dScripts/ai/NS/NS_PP_01" - "dScripts/ai/NS/WH" - "dScripts/ai/PROPERTY/AG" - "dScripts/ai/RACING/OBJECTS" - "dScripts/client/ai" - "dScripts/client/ai/PR" - "dScripts/zone/AG" - "dScripts/zone/LUPs" - "dScripts/zone/PROPERTY" - "dScripts/zone/PROPERTY/FV" - "dScripts/zone/PROPERTY/GF" - "dScripts/zone/PROPERTY/NS" - "thirdparty/magic_enum/include/magic_enum" "thirdparty/raknet/Source" "thirdparty/tinyxml2" @@ -382,12 +310,6 @@ add_subdirectory(dAuthServer) add_subdirectory(dChatServer) add_subdirectory(dMasterServer) # Add MasterServer last so it can rely on the other binaries -# Add our precompiled headers -target_precompile_headers( - dGame PRIVATE - ${HEADERS_DGAME} -) - target_precompile_headers( dZoneManager PRIVATE ${HEADERS_DZONEMANAGER} diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index 80f160426..ac7f38ccd 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -8,58 +8,27 @@ set(DGAME_SOURCES "Character.cpp" "User.cpp" "UserManager.cpp") -add_subdirectory(dBehaviors) +include_directories( + ${PROJECT_SOURCE_DIR}/dScripts + ${PROJECT_SOURCE_DIR}/dGame +) -foreach(file ${DGAME_DBEHAVIORS_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dBehaviors/${file}") -endforeach() +add_library(dGameBase ${DGAME_SOURCES}) +target_precompile_headers(dGameBase PRIVATE ${HEADERS_DGAME}) +target_link_libraries(dGameBase + PUBLIC dDatabase dPhysics + INTERFACE dComponents dEntity) +add_subdirectory(dBehaviors) add_subdirectory(dComponents) - -foreach(file ${DGAME_DCOMPONENTS_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dComponents/${file}") -endforeach() - add_subdirectory(dEntity) - -foreach(file ${DGAME_DENTITY_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dEntity/${file}") -endforeach() - add_subdirectory(dGameMessages) - -foreach(file ${DGAME_DGAMEMESSAGES_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dGameMessages/${file}") -endforeach() - add_subdirectory(dInventory) - -foreach(file ${DGAME_DINVENTORY_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dInventory/${file}") -endforeach() - add_subdirectory(dMission) - -foreach(file ${DGAME_DMISSION_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dMission/${file}") -endforeach() - add_subdirectory(dPropertyBehaviors) - -foreach(file ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dPropertyBehaviors/${file}") -endforeach() - add_subdirectory(dUtilities) -foreach(file ${DGAME_DUTILITIES_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "dUtilities/${file}") -endforeach() - -foreach(file ${DSCRIPTS_SOURCES}) - set(DGAME_SOURCES ${DGAME_SOURCES} "${PROJECT_SOURCE_DIR}/dScripts/${file}") -endforeach() - -add_library(dGame STATIC ${DGAME_SOURCES}) - -target_link_libraries(dGame dDatabase Recast Detour) +add_library(dGame INTERFACE) +target_link_libraries(dGame INTERFACE + dGameBase dBehaviors dComponents dEntity dGameMessages dInventory dMission dPropertyBehaviors dUtilities dScripts +) diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index d1926525f..fad239bc9 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -54,4 +54,9 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp" "TargetCasterBehavior.cpp" "TauntBehavior.cpp" "VentureVisionBehavior.cpp" - "VerifyBehavior.cpp" PARENT_SCOPE) + "VerifyBehavior.cpp") + +add_library(dBehaviors STATIC ${DGAME_DBEHAVIORS_SOURCES}) +target_link_libraries(dBehaviors + PUBLIC dPhysics) +target_precompile_headers(dBehaviors REUSE_FROM dGameBase) diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index d0bb89d3f..7b46fc77e 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -1,4 +1,5 @@ -set(DGAME_DCOMPONENTS_SOURCES "ActivityComponent.cpp" +set(DGAME_DCOMPONENTS_SOURCES + "ActivityComponent.cpp" "BaseCombatAIComponent.cpp" "BouncerComponent.cpp" "BuffComponent.cpp" @@ -46,5 +47,11 @@ set(DGAME_DCOMPONENTS_SOURCES "ActivityComponent.cpp" "HavokVehiclePhysicsComponent.cpp" "VendorComponent.cpp" "MiniGameControlComponent.cpp" - PARENT_SCOPE ) + +add_library(dComponents STATIC ${DGAME_DCOMPONENTS_SOURCES}) +target_include_directories(dComponents PRIVATE ${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General) # PetDigServer.h +target_precompile_headers(dComponents REUSE_FROM dGameBase) +target_link_libraries(dComponents + PUBLIC dPhysics dDatabase + INTERFACE dUtilities dCommon dBehaviors dChatFilter dMission dInventory) \ No newline at end of file diff --git a/dGame/dEntity/CMakeLists.txt b/dGame/dEntity/CMakeLists.txt index 4bb49799e..f59d7d142 100644 --- a/dGame/dEntity/CMakeLists.txt +++ b/dGame/dEntity/CMakeLists.txt @@ -1,2 +1,6 @@ -set(DGAME_DENTITY_SOURCES "EntityCallbackTimer.cpp" - "EntityTimer.cpp" PARENT_SCOPE) +set(DGAME_DENTITY_SOURCES + "EntityCallbackTimer.cpp" + "EntityTimer.cpp") + +add_library(dEntity STATIC ${DGAME_DENTITY_SOURCES}) +target_precompile_headers(dEntity REUSE_FROM dGameBase) diff --git a/dGame/dGameMessages/CMakeLists.txt b/dGame/dGameMessages/CMakeLists.txt index 3c3cb53f1..7373633cc 100644 --- a/dGame/dGameMessages/CMakeLists.txt +++ b/dGame/dGameMessages/CMakeLists.txt @@ -1,4 +1,9 @@ -set(DGAME_DGAMEMESSAGES_SOURCES "GameMessageHandler.cpp" +set(DGAME_DGAMEMESSAGES_SOURCES + "GameMessageHandler.cpp" "GameMessages.cpp" "PropertyDataMessage.cpp" - "PropertySelectQueryProperty.cpp" PARENT_SCOPE) + "PropertySelectQueryProperty.cpp") + +add_library(dGameMessages STATIC ${DGAME_DGAMEMESSAGES_SOURCES}) +target_link_libraries(dGameMessages PUBLIC dDatabase) +target_precompile_headers(dGameMessages REUSE_FROM dGameBase) diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index 60cfca756..a663a97d4 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -1,5 +1,9 @@ -set(DGAME_DINVENTORY_SOURCES "EquippedItem.cpp" +set(DGAME_DINVENTORY_SOURCES + "EquippedItem.cpp" "Inventory.cpp" "Item.cpp" "ItemSet.cpp" - "ItemSetPassiveAbility.cpp" PARENT_SCOPE) + "ItemSetPassiveAbility.cpp") + +add_library(dInventory STATIC ${DGAME_DINVENTORY_SOURCES}) +target_precompile_headers(dInventory REUSE_FROM dGameBase) diff --git a/dGame/dMission/CMakeLists.txt b/dGame/dMission/CMakeLists.txt index 652c3cb29..af9194285 100644 --- a/dGame/dMission/CMakeLists.txt +++ b/dGame/dMission/CMakeLists.txt @@ -1,3 +1,8 @@ -set(DGAME_DMISSION_SOURCES "Mission.cpp" +set(DGAME_DMISSION_SOURCES + "Mission.cpp" "MissionPrerequisites.cpp" - "MissionTask.cpp" PARENT_SCOPE) + "MissionTask.cpp") + +add_library(dMission STATIC ${DGAME_DMISSION_SOURCES}) +target_link_libraries(dMission PUBLIC dDatabase) +target_precompile_headers(dMission REUSE_FROM dGameBase) \ No newline at end of file diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 5e33a5f5c..425d6d654 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -9,4 +9,5 @@ foreach(file ${DGAME_DPROPERTYBEHAVIORS_CONTROLBEHAVIORMESSAGES}) set(DGAME_DPROPERTYBEHAVIORS_SOURCES ${DGAME_DPROPERTYBEHAVIORS_SOURCES} "ControlBehaviorMessages/${file}") endforeach() -set(DGAME_DPROPERTYBEHAVIORS_SOURCES ${DGAME_DPROPERTYBEHAVIORS_SOURCES} PARENT_SCOPE) +add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) +target_precompile_headers(dPropertyBehaviors REUSE_FROM dGameBase) diff --git a/dGame/dUtilities/CMakeLists.txt b/dGame/dUtilities/CMakeLists.txt index 639f9cf4e..952b268c3 100644 --- a/dGame/dUtilities/CMakeLists.txt +++ b/dGame/dUtilities/CMakeLists.txt @@ -5,4 +5,10 @@ set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp" "Mail.cpp" "Preconditions.cpp" "SlashCommandHandler.cpp" - "VanityUtilities.cpp" PARENT_SCOPE) + "VanityUtilities.cpp") + +add_library(dUtilities STATIC ${DGAME_DUTILITIES_SOURCES}) +target_precompile_headers(dUtilities REUSE_FROM dGameBase) +target_link_libraries(dUtilities + PUBLIC dDatabase dPhysics + INTERFACE dZoneManager) \ No newline at end of file diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index 938c04493..b4b77c82b 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -8,4 +8,10 @@ set(DNET_SOURCES "AuthPackets.cpp" "ZoneInstanceManager.cpp") add_library(dNet STATIC ${DNET_SOURCES}) -target_link_libraries(dNet dCommon dDatabase) +target_include_directories(dNet PRIVATE + ${PROJECT_SOURCE_DIR}/dGame/dComponents + ${PROJECT_SOURCE_DIR}/dScripts # transitive through components +) +target_link_libraries(dNet + PUBLIC dCommon dDatabase + INTERFACE dZoneManager) diff --git a/dPhysics/CMakeLists.txt b/dPhysics/CMakeLists.txt index 5fe6adaae..340e4c3c3 100644 --- a/dPhysics/CMakeLists.txt +++ b/dPhysics/CMakeLists.txt @@ -7,4 +7,6 @@ set(DPHYSICS_SOURCES "dpCollisionChecks.cpp" "dpWorld.cpp") add_library(dPhysics STATIC ${DPHYSICS_SOURCES}) -target_link_libraries(dPhysics Recast Detour) +target_link_libraries(dPhysics + PUBLIC Recast Detour + INTERFACE dNavigation) diff --git a/dScripts/02_server/CMakeLists.txt b/dScripts/02_server/CMakeLists.txt index 1e38386f6..51eb24c8a 100644 --- a/dScripts/02_server/CMakeLists.txt +++ b/dScripts/02_server/CMakeLists.txt @@ -8,10 +8,6 @@ endforeach() add_subdirectory(Enemy) -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_ENEMY}) - set(DSCRIPTS_SOURCES_02_SERVER ${DSCRIPTS_SOURCES_02_SERVER} "Enemy/${file}") -endforeach() - add_subdirectory(Equipment) foreach(file ${DSCRIPTS_SOURCES_02_SERVER_EQUIPMENT}) @@ -20,10 +16,6 @@ endforeach() add_subdirectory(Map) -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP}) - set(DSCRIPTS_SOURCES_02_SERVER ${DSCRIPTS_SOURCES_02_SERVER} "Map/${file}") -endforeach() - add_subdirectory(Minigame) foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MINIGAME}) @@ -38,8 +30,15 @@ endforeach() add_subdirectory(Pets) -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_PETS}) - set(DSCRIPTS_SOURCES_02_SERVER ${DSCRIPTS_SOURCES_02_SERVER} "Pets/${file}") -endforeach() - -set(DSCRIPTS_SOURCES_02_SERVER ${DSCRIPTS_SOURCES_02_SERVER} PARENT_SCOPE) +add_library(dScriptsServer STATIC ${DSCRIPTS_SOURCES_02_SERVER}) +target_include_directories(dScriptsServer PUBLIC "." + "DLU" + "Equipment" + "Minigame" + "Minigame/General" + "Objects" + "Pets") +target_link_libraries(dScriptsServer INTERFACE + dScriptsServerEnemy + dScriptsServerMap) +target_precompile_headers(dScriptsServer REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Enemy/CMakeLists.txt b/dScripts/02_server/Enemy/CMakeLists.txt index 408ff733e..f4b0eb958 100644 --- a/dScripts/02_server/Enemy/CMakeLists.txt +++ b/dScripts/02_server/Enemy/CMakeLists.txt @@ -42,4 +42,15 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_ENEMY_WAVES}) set(DSCRIPTS_SOURCES_02_SERVER_ENEMY ${DSCRIPTS_SOURCES_02_SERVER_ENEMY} "Waves/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_ENEMY ${DSCRIPTS_SOURCES_02_SERVER_ENEMY} PARENT_SCOPE) +add_library(dScriptsServerEnemy STATIC ${DSCRIPTS_SOURCES_02_SERVER_ENEMY}) +target_link_libraries(dScriptsServerEnemy dScriptsBase) +target_include_directories(dScriptsServerEnemy PUBLIC "." + "AG" + "AM" + "FV" + "General" + "Survival" + "VE" + "Waves" +) +target_precompile_headers(dScriptsServerEnemy PRIVATE ${HEADERS_DGAME}) diff --git a/dScripts/02_server/Map/AG/CMakeLists.txt b/dScripts/02_server/Map/AG/CMakeLists.txt index df26dee4b..a8315398e 100644 --- a/dScripts/02_server/Map/AG/CMakeLists.txt +++ b/dScripts/02_server/Map/AG/CMakeLists.txt @@ -12,5 +12,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG "AgMonumentRaceGoal.cpp" "AgMonumentRaceCancel.cpp" "NpcCowboyServer.cpp" - "NpcPirateServer.cpp" - PARENT_SCOPE) + "NpcPirateServer.cpp") + +add_library(dScriptsServerMapAG ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG}) +target_include_directories(dScriptsServerMapAG PUBLIC ".") +target_precompile_headers(dScriptsServerMapAG REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt b/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt index f4204c139..65019afe5 100644 --- a/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt +++ b/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt @@ -1,4 +1,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN "ZoneAgSpiderQueen.cpp" - "SpiderBossTreasureChestServer.cpp" - PARENT_SCOPE) + "SpiderBossTreasureChestServer.cpp") + +add_library(dScriptsServerMapAGSpiderQueen ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN}) +target_include_directories(dScriptsServerMapAGSpiderQueen PUBLIC ".") +target_link_libraries(dScriptsServerMapAGSpiderQueen dScriptsServerMapProperty) +target_precompile_headers(dScriptsServerMapAGSpiderQueen REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/AM/CMakeLists.txt b/dScripts/02_server/Map/AM/CMakeLists.txt index d3d13b734..177b3c455 100644 --- a/dScripts/02_server/Map/AM/CMakeLists.txt +++ b/dScripts/02_server/Map/AM/CMakeLists.txt @@ -15,5 +15,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AM "AmSkullkinDrillStand.cpp" "AmSkullkinTower.cpp" "AmBlueX.cpp" - "AmTeapotServer.cpp" - PARENT_SCOPE) + "AmTeapotServer.cpp") + +add_library(dScriptsServerMapAM ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM}) +target_include_directories(dScriptsServerMapAM PUBLIC ".") +target_precompile_headers(dScriptsServerMapAM REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/CMakeLists.txt b/dScripts/02_server/Map/CMakeLists.txt index feed8a973..a5fb5b031 100644 --- a/dScripts/02_server/Map/CMakeLists.txt +++ b/dScripts/02_server/Map/CMakeLists.txt @@ -1,81 +1,29 @@ -set(DSCRIPTS_SOURCES_02_SERVER_MAP) - add_subdirectory(AG) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "AG/${file}") -endforeach() - add_subdirectory(AG_Spider_Queen) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "AG_Spider_Queen/${file}") -endforeach() - add_subdirectory(AM) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "AM/${file}") -endforeach() - add_subdirectory(FV) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "FV/${file}") -endforeach() - add_subdirectory(General) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "General/${file}") -endforeach() - add_subdirectory(GF) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "GF/${file}") -endforeach() - add_subdirectory(njhub) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "njhub/${file}") -endforeach() - add_subdirectory(NS) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "NS/${file}") -endforeach() - add_subdirectory(NT) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "NT/${file}") -endforeach() - add_subdirectory(PR) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "PR/${file}") -endforeach() - add_subdirectory(Property) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "Property/${file}") -endforeach() - add_subdirectory(SS) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "SS/${file}") -endforeach() - add_subdirectory(VE) -foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE}) - set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} "VE/${file}") -endforeach() - -set(DSCRIPTS_SOURCES_02_SERVER_MAP ${DSCRIPTS_SOURCES_02_SERVER_MAP} PARENT_SCOPE) +add_library(dScriptsServerMap INTERFACE) +target_link_libraries(dScriptsServerMap INTERFACE + dScriptsServerMapAG + dScriptsServerMapAGSpiderQueen + dScriptsServerMapAM + dScriptsServerMapFV + dScriptsServerMapGeneral + dScriptsServerMapGF + dScriptsServerMapNJHub + dScriptsServerMapNS + dScriptsServerMapNT + dScriptsServerMapPR + dScriptsServerMapProperty + dScriptsServerMapSS + dScriptsServerMapVE) diff --git a/dScripts/02_server/Map/FV/CMakeLists.txt b/dScripts/02_server/Map/FV/CMakeLists.txt index 505d97c4e..6f774c987 100644 --- a/dScripts/02_server/Map/FV/CMakeLists.txt +++ b/dScripts/02_server/Map/FV/CMakeLists.txt @@ -11,4 +11,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV_RACING}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_FV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV} "Racing/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_MAP_FV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV} PARENT_SCOPE) +add_library(dScriptsServerMapFV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV}) +target_include_directories(dScriptsServerMapFV PUBLIC "." "Racing") +target_precompile_headers(dScriptsServerMapFV REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/GF/CMakeLists.txt b/dScripts/02_server/Map/GF/CMakeLists.txt index 90cc38a59..45ec871a3 100644 --- a/dScripts/02_server/Map/GF/CMakeLists.txt +++ b/dScripts/02_server/Map/GF/CMakeLists.txt @@ -2,5 +2,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GF "GfTikiTorch.cpp" "GfCaptainsCannon.cpp" "MastTeleport.cpp" - "SpawnLionServer.cpp" - PARENT_SCOPE) + "SpawnLionServer.cpp") + +add_library(dScriptsServerMapGF ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF}) +target_include_directories(dScriptsServerMapGF PUBLIC ".") +target_precompile_headers(dScriptsServerMapGF REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/General/CMakeLists.txt b/dScripts/02_server/Map/General/CMakeLists.txt index 797b53ed6..4fe5aae89 100644 --- a/dScripts/02_server/Map/General/CMakeLists.txt +++ b/dScripts/02_server/Map/General/CMakeLists.txt @@ -7,7 +7,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL "ForceVolumeServer.cpp" "GrowingFlower.cpp" "ImaginationBackpackHealServer.cpp" - "InvalidScript.cpp" "MailBoxServer.cpp" "NjRailSwitch.cpp" "PetDigServer.cpp" @@ -28,4 +27,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL_NINJAGO}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL} "Ninjago/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL} PARENT_SCOPE) +add_library(dScriptsServerMapGeneral ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL}) +target_include_directories(dScriptsServerMapGeneral PUBLIC "." "Ninjago") +target_precompile_headers(dScriptsServerMapGeneral REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/NS/CMakeLists.txt b/dScripts/02_server/Map/NS/CMakeLists.txt index c815a8c51..4927f0c87 100644 --- a/dScripts/02_server/Map/NS/CMakeLists.txt +++ b/dScripts/02_server/Map/NS/CMakeLists.txt @@ -10,4 +10,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS_WAVES}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} "Waves/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} PARENT_SCOPE) +add_library(dScriptsServerMapNS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS}) +target_include_directories(dScriptsServerMapNS PUBLIC "." "Waves") +target_precompile_headers(dScriptsServerMapNS REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/NT/CMakeLists.txt b/dScripts/02_server/Map/NT/CMakeLists.txt index 533a70c94..49c6a5aea 100644 --- a/dScripts/02_server/Map/NT/CMakeLists.txt +++ b/dScripts/02_server/Map/NT/CMakeLists.txt @@ -25,5 +25,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NT "NtVentureSpeedPadServer.cpp" "NtVentureCannonServer.cpp" "NtBcSubmitServer.cpp" - "NtNaomiBreadcrumbServer.cpp" - PARENT_SCOPE) + "NtNaomiBreadcrumbServer.cpp") + +add_library(dScriptsServerMapNT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT}) +target_include_directories(dScriptsServerMapNT PUBLIC ".") +target_precompile_headers(dScriptsServerMapNT REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/PR/CMakeLists.txt b/dScripts/02_server/Map/PR/CMakeLists.txt index 3a32e9f3c..13b3fd35e 100644 --- a/dScripts/02_server/Map/PR/CMakeLists.txt +++ b/dScripts/02_server/Map/PR/CMakeLists.txt @@ -1,5 +1,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_PR "HydrantBroken.cpp" "PrSeagullFly.cpp" - "SpawnGryphonServer.cpp" - PARENT_SCOPE) + "SpawnGryphonServer.cpp") + +add_library(dScriptsServerMapPR ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR}) +target_include_directories(dScriptsServerMapPR PUBLIC ".") +target_precompile_headers(dScriptsServerMapPR REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/Property/CMakeLists.txt b/dScripts/02_server/Map/Property/CMakeLists.txt index 74badb326..52b91d0bf 100644 --- a/dScripts/02_server/Map/Property/CMakeLists.txt +++ b/dScripts/02_server/Map/Property/CMakeLists.txt @@ -19,4 +19,9 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY_NS_MED}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY} "NS_Med/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY} PARENT_SCOPE) +add_library(dScriptsServerMapProperty ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY}) +target_precompile_headers(dScriptsServerMapProperty REUSE_FROM dScriptsBase) +target_include_directories(dScriptsServerMapProperty PUBLIC "." + "AG_Med" + "AG_Small" + "NS_Med") diff --git a/dScripts/02_server/Map/SS/CMakeLists.txt b/dScripts/02_server/Map/SS/CMakeLists.txt index 49db031f9..ed6a7596f 100644 --- a/dScripts/02_server/Map/SS/CMakeLists.txt +++ b/dScripts/02_server/Map/SS/CMakeLists.txt @@ -1,3 +1,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_SS - "SsModularBuildServer.cpp" - PARENT_SCOPE) + "SsModularBuildServer.cpp") + +add_library(dScriptsServerMapSS ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS}) +target_include_directories(dScriptsServerMapSS PUBLIC ".") +target_precompile_headers(dScriptsServerMapSS REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/VE/CMakeLists.txt b/dScripts/02_server/Map/VE/CMakeLists.txt index ac3a64617..2dbcaaffe 100644 --- a/dScripts/02_server/Map/VE/CMakeLists.txt +++ b/dScripts/02_server/Map/VE/CMakeLists.txt @@ -1,5 +1,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_VE "VeMissionConsole.cpp" "VeEpsilonServer.cpp" - "VeBricksampleServer.cpp" - PARENT_SCOPE) + "VeBricksampleServer.cpp") + +add_library(dScriptsServerMapVE ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE}) +target_include_directories(dScriptsServerMapVE PUBLIC ".") +target_precompile_headers(dScriptsServerMapVE REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/njhub/CMakeLists.txt b/dScripts/02_server/Map/njhub/CMakeLists.txt index 2527d1ad7..0f287ce32 100644 --- a/dScripts/02_server/Map/njhub/CMakeLists.txt +++ b/dScripts/02_server/Map/njhub/CMakeLists.txt @@ -28,4 +28,11 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB_BOSS_INSTANCE}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB} "boss_instance/${file}") endforeach() -set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB} PARENT_SCOPE) +add_library(dScriptsServerMapNJHub ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB}) +target_include_directories(dScriptsServerMapNJHub PUBLIC "." "boss_instance") +target_link_libraries(dScriptsServerMapNJHub + dScriptsServerPets + dScriptsServerMapAM + dScriptsServerMapGeneral +) +target_precompile_headers(dScriptsServerMapNJHub REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Pets/CMakeLists.txt b/dScripts/02_server/Pets/CMakeLists.txt index 8820a82e1..79123ebec 100644 --- a/dScripts/02_server/Pets/CMakeLists.txt +++ b/dScripts/02_server/Pets/CMakeLists.txt @@ -1,5 +1,9 @@ set(DSCRIPTS_SOURCES_02_SERVER_PETS "PetFromDigServer.cpp" "PetFromObjectServer.cpp" - "DamagingPets.cpp" - PARENT_SCOPE) + "DamagingPets.cpp") + +add_library(dScriptsServerPets STATIC ${DSCRIPTS_SOURCES_02_SERVER_PETS}) +target_include_directories(dScriptsServerPets PUBLIC ".") +target_precompile_headers(dScriptsServerPets REUSE_FROM dScriptsBase) + diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index ac600dbc2..0a025e226 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -7,48 +7,44 @@ set(DSCRIPTS_SOURCES "BaseWavesGenericEnemy.cpp" "BaseWavesServer.cpp" "ChooseYourDestinationNsToNt.cpp" - "CppScripts.cpp" "Darkitect.cpp" + "InvalidScript.cpp" "NPCAddRemoveItem.cpp" "NtFactionSpyServer.cpp" "ScriptComponent.cpp" "ScriptedPowerupSpawner.cpp" "SpawnPetBaseServer.cpp") -add_subdirectory(02_server) - -foreach(file ${DSCRIPTS_SOURCES_02_SERVER}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "02_server/${file}") -endforeach() +link_libraries(dDatabase dPhysics) -add_subdirectory(ai) +add_library(dScriptsBase STATIC ${DSCRIPTS_SOURCES}) +target_include_directories(dScriptsBase PUBLIC .) +target_link_libraries(dScriptsBase + INTERFACE dGameBase) +target_precompile_headers(dScriptsBase PRIVATE ${HEADERS_DGAME}) -foreach(file ${DSCRIPTS_SOURCES_AI}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "ai/${file}") -endforeach() +include_directories( + ${PROJECT_SOURCE_DIR}/dScripts + ${PROJECT_SOURCE_DIR}/dGame +) +link_libraries(dScriptsBase) +# dComponents +add_subdirectory(02_server) +add_subdirectory(ai) add_subdirectory(client) - -foreach(file ${DSCRIPTS_SOURCES_CLIENT}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "client/${file}") -endforeach() - add_subdirectory(EquipmentScripts) - -foreach(file ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "EquipmentScripts/${file}") -endforeach() - add_subdirectory(EquipmentTriggers) - -foreach(file ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "EquipmentTriggers/${file}") -endforeach() - add_subdirectory(zone) -foreach(file ${DSCRIPTS_SOURCES_ZONE}) - set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} "zone/${file}") -endforeach() - -set(DSCRIPTS_SOURCES ${DSCRIPTS_SOURCES} PARENT_SCOPE) +add_library(dScripts STATIC "CppScripts.cpp") +target_precompile_headers(dScripts REUSE_FROM dScriptsBase) +target_include_directories(dScripts PUBLIC .) +target_link_libraries(dScripts + dScriptsBase + dScriptsServer + dScriptsAI + dScriptsClient + dScriptsEquipmentScripts + dScriptsEquipmentTriggers + dScriptsZone) diff --git a/dScripts/EquipmentScripts/CMakeLists.txt b/dScripts/EquipmentScripts/CMakeLists.txt index 696be03d6..08966e08f 100644 --- a/dScripts/EquipmentScripts/CMakeLists.txt +++ b/dScripts/EquipmentScripts/CMakeLists.txt @@ -6,5 +6,8 @@ set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS "PersonalFortress.cpp" "BuccaneerValiantShip.cpp" "FireFirstSkillonStartup.cpp" - "StunImmunity.cpp" - PARENT_SCOPE) + "StunImmunity.cpp") + +add_library(dScriptsEquipmentScripts STATIC ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS}) +target_include_directories(dScriptsEquipmentScripts PUBLIC ".") +target_precompile_headers(dScriptsEquipmentScripts REUSE_FROM dScriptsBase) diff --git a/dScripts/EquipmentTriggers/CMakeLists.txt b/dScripts/EquipmentTriggers/CMakeLists.txt index 416ef5535..cb6e81a86 100644 --- a/dScripts/EquipmentTriggers/CMakeLists.txt +++ b/dScripts/EquipmentTriggers/CMakeLists.txt @@ -1,3 +1,6 @@ set(DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS - "CoilBackpackBase.cpp" - PARENT_SCOPE) + "CoilBackpackBase.cpp") + +add_library(dScriptsEquipmentTriggers STATIC ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS}) +target_include_directories(dScriptsEquipmentTriggers PUBLIC ".") +target_precompile_headers(dScriptsEquipmentTriggers REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/General/InvalidScript.cpp b/dScripts/InvalidScript.cpp similarity index 100% rename from dScripts/02_server/Map/General/InvalidScript.cpp rename to dScripts/InvalidScript.cpp diff --git a/dScripts/02_server/Map/General/InvalidScript.h b/dScripts/InvalidScript.h similarity index 100% rename from dScripts/02_server/Map/General/InvalidScript.h rename to dScripts/InvalidScript.h diff --git a/dScripts/ai/ACT/CMakeLists.txt b/dScripts/ai/ACT/CMakeLists.txt index 79deededa..5071afa0e 100644 --- a/dScripts/ai/ACT/CMakeLists.txt +++ b/dScripts/ai/ACT/CMakeLists.txt @@ -9,4 +9,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_ACT_FOOTRACE}) set(DSCRIPTS_SOURCES_AI_ACT ${DSCRIPTS_SOURCES_AI_ACT} "FootRace/${file}") endforeach() -set(DSCRIPTS_SOURCES_AI_ACT ${DSCRIPTS_SOURCES_AI_ACT} PARENT_SCOPE) +add_library(dScriptsAiAct STATIC ${DSCRIPTS_SOURCES_AI_ACT}) +target_include_directories(dScriptsAiAct PUBLIC "." "FootRace") +target_precompile_headers(dScriptsAiAct REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/AG/CMakeLists.txt b/dScripts/ai/AG/CMakeLists.txt index 092b8de77..e031e386d 100644 --- a/dScripts/ai/AG/CMakeLists.txt +++ b/dScripts/ai/AG/CMakeLists.txt @@ -14,5 +14,8 @@ set(DSCRIPTS_SOURCES_AI_AG "AgDarkSpiderling.cpp" "AgPicnicBlanket.cpp" "AgStagePlatforms.cpp" - "AgQbWall.cpp" - PARENT_SCOPE) + "AgQbWall.cpp") + +add_library(dScriptsAiAG STATIC ${DSCRIPTS_SOURCES_AI_AG}) +target_include_directories(dScriptsAiAG PUBLIC ".") +target_precompile_headers(dScriptsAiAG REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/CMakeLists.txt b/dScripts/ai/CMakeLists.txt index 44944b901..7e94cd349 100644 --- a/dScripts/ai/CMakeLists.txt +++ b/dScripts/ai/CMakeLists.txt @@ -1,81 +1,32 @@ set(DSCRIPTS_SOURCES_AI) add_subdirectory(ACT) - -foreach(file ${DSCRIPTS_SOURCES_AI_ACT}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "ACT/${file}") -endforeach() - add_subdirectory(AG) - -foreach(file ${DSCRIPTS_SOURCES_AI_AG}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "AG/${file}") -endforeach() - add_subdirectory(FV) - -foreach(file ${DSCRIPTS_SOURCES_AI_FV}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "FV/${file}") -endforeach() - add_subdirectory(GENERAL) - -foreach(file ${DSCRIPTS_SOURCES_AI_GENERAL}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "GENERAL/${file}") -endforeach() - add_subdirectory(GF) - -foreach(file ${DSCRIPTS_SOURCES_AI_GF}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "GF/${file}") -endforeach() - add_subdirectory(MINIGAME) - -foreach(file ${DSCRIPTS_SOURCES_AI_MINIGAME}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "MINIGAME/${file}") -endforeach() - add_subdirectory(NP) - -foreach(file ${DSCRIPTS_SOURCES_AI_NP}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "NP/${file}") -endforeach() - add_subdirectory(NS) - -foreach(file ${DSCRIPTS_SOURCES_AI_NS}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "NS/${file}") -endforeach() - add_subdirectory(PETS) - -foreach(file ${DSCRIPTS_SOURCES_AI_PETS}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "PETS/${file}") -endforeach() - add_subdirectory(PROPERTY) - -foreach(file ${DSCRIPTS_SOURCES_AI_PROPERTY}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "PROPERTY/${file}") -endforeach() - add_subdirectory(RACING) - -foreach(file ${DSCRIPTS_SOURCES_AI_RACING}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "RACING/${file}") -endforeach() - add_subdirectory(SPEC) - -foreach(file ${DSCRIPTS_SOURCES_AI_SPEC}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "SPEC/${file}") -endforeach() - add_subdirectory(WILD) -foreach(file ${DSCRIPTS_SOURCES_AI_WILD}) - set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} "WILD/${file}") -endforeach() - -set(DSCRIPTS_SOURCES_AI ${DSCRIPTS_SOURCES_AI} PARENT_SCOPE) +add_library(dScriptsAI INTERFACE) +target_link_libraries(dScriptsAI INTERFACE + dScriptsAiAct + dScriptsAiAG + dScriptsAiFV + dScriptsAiGeneral + dScriptsAiGF + dScriptsAiMinigame + dScriptsAiNP + dScriptsAiNS + dScriptsAiPets + dScriptsAiProperty + dScriptsAiRacing + dScriptsAiSpec + dScriptsAiWild +) diff --git a/dScripts/ai/FV/CMakeLists.txt b/dScripts/ai/FV/CMakeLists.txt index 56418706e..55c68a270 100644 --- a/dScripts/ai/FV/CMakeLists.txt +++ b/dScripts/ai/FV/CMakeLists.txt @@ -16,5 +16,9 @@ set(DSCRIPTS_SOURCES_AI_FV "FvPassThroughWall.cpp" "FvBounceOverWall.cpp" "FvMaelstromGeyser.cpp" - "TriggerGas.cpp" - PARENT_SCOPE) + "TriggerGas.cpp") + +add_library(dScriptsAiFV STATIC ${DSCRIPTS_SOURCES_AI_FV}) +target_include_directories(dScriptsAiFV PUBLIC ".") +target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase) + diff --git a/dScripts/ai/GENERAL/CMakeLists.txt b/dScripts/ai/GENERAL/CMakeLists.txt index da9736589..9b7f2a2ab 100644 --- a/dScripts/ai/GENERAL/CMakeLists.txt +++ b/dScripts/ai/GENERAL/CMakeLists.txt @@ -1,4 +1,8 @@ set(DSCRIPTS_SOURCES_AI_GENERAL "InstanceExitTransferPlayerToLastNonInstance.cpp" - "LegoDieRoll.cpp" - PARENT_SCOPE) + "LegoDieRoll.cpp") + +add_library(dScriptsAiGeneral STATIC ${DSCRIPTS_SOURCES_AI_GENERAL}) +target_include_directories(dScriptsAiGeneral PUBLIC ".") +target_precompile_headers(dScriptsAiGeneral REUSE_FROM dScriptsBase) + diff --git a/dScripts/ai/GF/CMakeLists.txt b/dScripts/ai/GF/CMakeLists.txt index 9937618cc..7a7a17235 100644 --- a/dScripts/ai/GF/CMakeLists.txt +++ b/dScripts/ai/GF/CMakeLists.txt @@ -10,5 +10,8 @@ set(DSCRIPTS_SOURCES_AI_GF "GfArchway.cpp" "GfMaelstromGeyser.cpp" "PirateRep.cpp" - "GfParrotCrash.cpp" - PARENT_SCOPE) + "GfParrotCrash.cpp") + +add_library(dScriptsAiGF STATIC ${DSCRIPTS_SOURCES_AI_GF}) +target_include_directories(dScriptsAiGF PUBLIC ".") +target_precompile_headers(dScriptsAiGF REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/MINIGAME/CMakeLists.txt b/dScripts/ai/MINIGAME/CMakeLists.txt index f01870577..0e07d526a 100644 --- a/dScripts/ai/MINIGAME/CMakeLists.txt +++ b/dScripts/ai/MINIGAME/CMakeLists.txt @@ -12,4 +12,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_MINIGAME_OBJECTS}) set(DSCRIPTS_SOURCES_AI_MINIGAME ${DSCRIPTS_SOURCES_AI_MINIGAME} "Objects/${file}") endforeach() -set(DSCRIPTS_SOURCES_AI_MINIGAME ${DSCRIPTS_SOURCES_AI_MINIGAME} PARENT_SCOPE) +add_library(dScriptsAiMinigame STATIC ${DSCRIPTS_SOURCES_AI_MINIGAME}) +target_include_directories(dScriptsAiMinigame PUBLIC "." "Objects" "SG_GF" "SG_GF/SERVER") +target_precompile_headers(dScriptsAiMinigame REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/NP/CMakeLists.txt b/dScripts/ai/NP/CMakeLists.txt index 39a7301af..9f3f6a651 100644 --- a/dScripts/ai/NP/CMakeLists.txt +++ b/dScripts/ai/NP/CMakeLists.txt @@ -1,3 +1,6 @@ set(DSCRIPTS_SOURCES_AI_NP - "NpcNpSpacemanBob.cpp" - PARENT_SCOPE) + "NpcNpSpacemanBob.cpp") + +add_library(dScriptsAiNP STATIC ${DSCRIPTS_SOURCES_AI_NP}) +target_include_directories(dScriptsAiNP PUBLIC ".") +target_precompile_headers(dScriptsAiNP REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/NS/CMakeLists.txt b/dScripts/ai/NS/CMakeLists.txt index e8ec84b1a..0f0aa0c78 100644 --- a/dScripts/ai/NS/CMakeLists.txt +++ b/dScripts/ai/NS/CMakeLists.txt @@ -21,4 +21,8 @@ foreach(file ${DSCRIPTS_SOURCES_AI_NS_WH}) set(DSCRIPTS_SOURCES_AI_NS ${DSCRIPTS_SOURCES_AI_NS} "WH/${file}") endforeach() -set(DSCRIPTS_SOURCES_AI_NS ${DSCRIPTS_SOURCES_AI_NS} PARENT_SCOPE) +add_library(dScriptsAiNS STATIC ${DSCRIPTS_SOURCES_AI_NS}) +target_include_directories(dScriptsAiNS PUBLIC "." "NS_PP_01" "WH" +PRIVATE + ${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/NS) # NsConcertChoiceBuildManager.h +target_precompile_headers(dScriptsAiNS REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/PETS/CMakeLists.txt b/dScripts/ai/PETS/CMakeLists.txt index 93a9012dc..8bd8630c3 100644 --- a/dScripts/ai/PETS/CMakeLists.txt +++ b/dScripts/ai/PETS/CMakeLists.txt @@ -1,3 +1,6 @@ set(DSCRIPTS_SOURCES_AI_PETS - "HydrantSmashable.cpp" - PARENT_SCOPE) + "HydrantSmashable.cpp") + +add_library(dScriptsAiPets STATIC ${DSCRIPTS_SOURCES_AI_PETS}) +target_include_directories(dScriptsAiPets PUBLIC "." "NS_PP_01" "WH") +target_precompile_headers(dScriptsAiPets REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/PROPERTY/CMakeLists.txt b/dScripts/ai/PROPERTY/CMakeLists.txt index 295137b46..a31b9257e 100644 --- a/dScripts/ai/PROPERTY/CMakeLists.txt +++ b/dScripts/ai/PROPERTY/CMakeLists.txt @@ -8,4 +8,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_PROPERTY_AG}) set(DSCRIPTS_SOURCES_AI_PROPERTY ${DSCRIPTS_SOURCES_AI_PROPERTY} "AG/${file}") endforeach() -set(DSCRIPTS_SOURCES_AI_PROPERTY ${DSCRIPTS_SOURCES_AI_PROPERTY} PARENT_SCOPE) +add_library(dScriptsAiProperty STATIC ${DSCRIPTS_SOURCES_AI_PROPERTY}) +target_include_directories(dScriptsAiProperty PUBLIC "." "AG") +target_precompile_headers(dScriptsAiProperty REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/RACING/CMakeLists.txt b/dScripts/ai/RACING/CMakeLists.txt index 0c1918de2..b7343c61b 100644 --- a/dScripts/ai/RACING/CMakeLists.txt +++ b/dScripts/ai/RACING/CMakeLists.txt @@ -6,4 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS}) set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}") endforeach() -set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} PARENT_SCOPE) +add_library(dScriptsAiRacing STATIC ${DSCRIPTS_SOURCES_AI_RACING}) +target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS") +target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/SPEC/CMakeLists.txt b/dScripts/ai/SPEC/CMakeLists.txt index 42dbf8f8b..c60372ac1 100644 --- a/dScripts/ai/SPEC/CMakeLists.txt +++ b/dScripts/ai/SPEC/CMakeLists.txt @@ -1,5 +1,8 @@ set(DSCRIPTS_SOURCES_AI_SPEC "SpecialCoinSpawner.cpp" "SpecialPowerupSpawner.cpp" - "SpecialSpeedBuffSpawner.cpp" - PARENT_SCOPE) + "SpecialSpeedBuffSpawner.cpp") + +add_library(dScriptsAiSpec STATIC ${DSCRIPTS_SOURCES_AI_SPEC}) +target_include_directories(dScriptsAiSpec PUBLIC ".") +target_precompile_headers(dScriptsAiSpec REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/WILD/CMakeLists.txt b/dScripts/ai/WILD/CMakeLists.txt index 446ce0d40..418ffb5f4 100644 --- a/dScripts/ai/WILD/CMakeLists.txt +++ b/dScripts/ai/WILD/CMakeLists.txt @@ -7,5 +7,8 @@ set(DSCRIPTS_SOURCES_AI_WILD "WildNinjaBricks.cpp" "WildNinjaStudent.cpp" "WildNinjaSensei.cpp" - "WildPants.cpp" - PARENT_SCOPE) + "WildPants.cpp") + +add_library(dScriptsAiWild STATIC ${DSCRIPTS_SOURCES_AI_WILD}) +target_include_directories(dScriptsAiWild PUBLIC ".") +target_precompile_headers(dScriptsAiWild REUSE_FROM dScriptsBase) diff --git a/dScripts/client/CMakeLists.txt b/dScripts/client/CMakeLists.txt index c27775082..b3ad08fbd 100644 --- a/dScripts/client/CMakeLists.txt +++ b/dScripts/client/CMakeLists.txt @@ -6,4 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_CLIENT_AI}) set(DSCRIPTS_SOURCES_CLIENT ${DSCRIPTS_SOURCES_CLIENT} "ai/${file}") endforeach() -set(DSCRIPTS_SOURCES_CLIENT ${DSCRIPTS_SOURCES_CLIENT} PARENT_SCOPE) +add_library(dScriptsClient STATIC ${DSCRIPTS_SOURCES_CLIENT}) +target_include_directories(dScriptsClient PUBLIC "." "ai" "ai/PR") +target_precompile_headers(dScriptsClient REUSE_FROM dScriptsBase) diff --git a/dScripts/zone/CMakeLists.txt b/dScripts/zone/CMakeLists.txt index 5d8000315..93ea70ca7 100644 --- a/dScripts/zone/CMakeLists.txt +++ b/dScripts/zone/CMakeLists.txt @@ -18,4 +18,12 @@ foreach(file ${DSCRIPTS_SOURCES_ZONE_PROPERTY}) set(DSCRIPTS_SOURCES_ZONE ${DSCRIPTS_SOURCES_ZONE} "PROPERTY/${file}") endforeach() -set(DSCRIPTS_SOURCES_ZONE ${DSCRIPTS_SOURCES_ZONE} PARENT_SCOPE) +add_library(dScriptsZone STATIC ${DSCRIPTS_SOURCES_ZONE}) +target_include_directories(dScriptsZone PUBLIC "." + "AG" + "LUPs" + "PROPERTY" + "PROPERTY/FV" + "PROPERTY/GF" + "PROPERTY/NS") +target_precompile_headers(dScriptsZone REUSE_FROM dScriptsBase) diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index bbb22ba7d..e73823678 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -4,4 +4,6 @@ set(DZONEMANAGER_SOURCES "dZoneManager.cpp" "Zone.cpp") add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES}) -target_link_libraries(dZoneManager dPhysics) +target_link_libraries(dZoneManager + PUBLIC dPhysics + INTERFACE dWorldServer)