-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
184 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.26) | ||
|
||
SET(REPOSITORY_URL "https://github.com/antonpup/Dota2GSI") | ||
|
||
set(CMAKE_SUPPRESS_REGENERATION true) | ||
|
||
PROJECT(Dota2GSI LANGUAGES CSharp CXX) | ||
|
||
# Set global .NET Framework version. | ||
SET(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "8.0") | ||
|
||
# Set the C# language version for all projects. | ||
SET(CMAKE_CSharp_FLAGS "/langversion:6") | ||
|
||
# Explicitly set the `PlatformTarget` for C# projects, since AnyCPU can result in | ||
# System.BadImageFormatException throws, when trying to load C++/CLI assemblies. | ||
IF(CMAKE_GENERATOR_PLATFORM STREQUAL "x64") | ||
SET(CMAKE_CSharp_FLAGS "/platform:x64") | ||
ELSEIF(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") | ||
SET(CMAKE_CSharp_FLAGS "/platform:x86") | ||
ELSE() | ||
MESSAGE(WARNING "Generator platform is set to '${CMAKE_GENERATOR_PLATFORM}', which is not supported by managed projects. Defaulting to 'AnyCPU'...") | ||
SET(CMAKE_CSharp_FLAGS "/platform:AnyCPU") | ||
ENDIF() | ||
|
||
# Define runtime intermediate build directory, so that debugging the Visual Studio solution works as expected. | ||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/binaries/") | ||
|
||
# Set export directory for CMake config. | ||
SET(CMAKE_INSTALL_BINARY_DIR "bin/") | ||
SET(CMAKE_INSTALL_LIBRARY_DIR "bin/") | ||
SET(CMAKE_INSTALL_INCLUDE_DIR "include/") | ||
SET(CMAKE_INSTALL_EXPORT_DIR "cmake/") | ||
|
||
# Include sub-projects. | ||
ADD_SUBDIRECTORY(Dota2GSI) | ||
|
||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Dota2GSI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Setup project. | ||
SET(PRODUCT Dota2GSI) | ||
SET(PRODUCT_NAME "${PRODUCT}") | ||
SET(PRODUCT_VERSION 2.0.0) | ||
SET(PRODUCT_DESCRIPTION "A C# library to interface the Game State Integration found in Dota 2.") | ||
SET(PRODUCT_AUTHORS "Anton Pupkov") | ||
SET(PRODUCT_COPYRIGHT "Copyright© 2024") | ||
|
||
if(DEFINED BUILD_NUMBER) | ||
SET(PRODUCT_VERSION "${PRODUCT_VERSION}.${BUILD_NUMBER}") | ||
endif() | ||
|
||
PROJECT(${PRODUCT} VERSION ${PRODUCT_VERSION} LANGUAGES CSharp) | ||
|
||
# Setup project to use C# utilities. | ||
INCLUDE(CSharpUtilities) | ||
|
||
SET(SOURCES | ||
GameState.cs | ||
GameStateListener.cs | ||
Nodes/Roshan.cs | ||
Nodes/HeroProvider/HeroDetails.cs | ||
Nodes/CouriersProvider/Courier.cs | ||
Nodes/MinimapProvider/MinimapElement.cs | ||
Nodes/Helpers/Vector2D.cs | ||
Nodes/Helpers/FullTeamDetails.cs | ||
Nodes/Helpers/FullPlayerDetails.cs | ||
Nodes/RoshanProvider/ItemsDrop.cs | ||
Nodes/League.cs | ||
Nodes/LeagueProvider/Stream.cs | ||
Nodes/Wearables.cs | ||
Nodes/WearablesProvider/WearableItem.cs | ||
Nodes/WearablesProvider/PlayerWearables.cs | ||
Nodes/NeutralItemsProvider/NeutralTierInfo.cs | ||
Nodes/NeutralItems.cs | ||
Nodes/NeutralItemsProvider/TeamNeutralItems.cs | ||
Nodes/NeutralItemsProvider/NeutralItem.cs | ||
Nodes/Minimap.cs | ||
Nodes/Hero.cs | ||
Nodes/LeagueProvider/SelectionPriority.cs | ||
Nodes/LeagueProvider/LeagueTeam.cs | ||
Nodes/Items.cs | ||
Nodes/ItemsProvider/Item.cs | ||
Nodes/ItemsProvider/ItemDetails.cs | ||
Nodes/Events.cs | ||
Nodes/EventsProvider/Event.cs | ||
Nodes/Draft.cs | ||
Nodes/DraftProvider/DraftDetails.cs | ||
Nodes/Couriers.cs | ||
Nodes/CouriersProvider/CourierItem.cs | ||
Nodes/Buildings.cs | ||
Nodes/BuildingsProvider/BuildingLayout.cs | ||
Nodes/BuildingsProvider/Building.cs | ||
Nodes/Abilities.cs | ||
Nodes/AbilitiesProvider/Ability.cs | ||
Nodes/AbilitiesProvider/AbilityDetails.cs | ||
Nodes/Player.cs | ||
Nodes/PlayerProvider/PlayerDetails.cs | ||
Nodes/Node.cs | ||
Nodes/Provider.cs | ||
Nodes/Map.cs | ||
Nodes/Auth.cs | ||
) | ||
|
||
SET(README "${CMAKE_SOURCE_DIR}/README.md") | ||
|
||
# Add shared library project. | ||
ADD_LIBRARY(${PROJECT_NAME} SHARED | ||
${README} | ||
${SOURCES} | ||
) | ||
|
||
# Define dependencies. | ||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} | ||
PUBLIC CommonLib | ||
) | ||
|
||
SET(NET_REFERENCES | ||
) | ||
|
||
SET(NUGET_PACKAGES | ||
"Microsoft.CSharp_4.7.0" | ||
"System.Data.DataSetExtensions_4.5.0" | ||
"Newtonsoft.Json_13.0.3" | ||
) | ||
|
||
# Set .Net | ||
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES | ||
DOTNET_SDK "Microsoft.NET.Sdk" | ||
DOTNET_TARGET_FRAMEWORK "net8.0" | ||
VS_DOTNET_REFERENCES "${NET_REFERENCES}" | ||
VS_GLOBAL_ROOTNAMESPACE ${PROJECT_NAME} | ||
VS_PACKAGE_REFERENCES "${NUGET_PACKAGES}" | ||
) | ||
|
||
# Set readme file | ||
SET_SOURCE_FILES_PROPERTIES(${README} PROPERTIES | ||
VS_CSHARP_Pack "True" | ||
VS_CSHARP_PackagePath "\\") | ||
|
||
# Set project configuration | ||
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES | ||
VS_GLOBAL_GenerateAssemblyInfo "True" | ||
VS_GLOBAL_GenerateDocumentationFile "True" | ||
VS_GLOBAL_GeneratePackageOnBuild "True" | ||
VS_GLOBAL_TreatWarningsAsErrors "True" | ||
VS_GLOBAL_PackageProjectUrl ${REPOSITORY_URL} | ||
VS_GLOBAL_RepositoryUrl ${REPOSITORY_URL} | ||
VS_GLOBAL_PackageReadmeFile "README.md" | ||
) | ||
|
||
# Set Assembly information | ||
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES | ||
VS_GLOBAL_Authors "${PRODUCT_AUTHORS}" | ||
VS_GLOBAL_Version "${PRODUCT_VERSION}" | ||
VS_GLOBAL_Description "${PRODUCT_DESCRIPTION}" | ||
VS_GLOBAL_Product "${PRODUCT_NAME}" | ||
VS_GLOBAL_Copyright "${PRODUCT_COPYRIGHT}" | ||
) | ||
|
||
# Export config. | ||
EXPORT(TARGETS ${PROJECT_NAME} FILE ${PROJECT_NAME}Config.cmake) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.