CMake integration for Valve's Steamworks SDK.
Integrate the SDK directly into your CMake project using FetchContent:
include(FetchContent)
FetchContent_Declare(
SteamworksSDK
GIT_REPOSITORY https://github.com/Waffle0823/SteamworksSDK.git
GIT_TAG main
)
FetchContent_MakeAvailable(SteamworksSDK)
add_executable(my_game main.cpp)
target_link_libraries(my_game PRIVATE Steamworks::API)
# Optional: encrypted app ticket library
# target_link_libraries(my_game PRIVATE Steamworks::EncryptedAppTicket)By default the SDK is fetched from a public mirror, so no authentication is required:
cmake -B build
cmake --build buildIf you disable the mirror (-DSTEAMWORKS_USE_SDK_MIRROR=OFF) the SDK is
downloaded directly from Steamworks, which requires a valid steamLoginSecure
cookie from a Steamworks partner account. Export it before configuring CMake:
export STEAM_LOGIN_SECURE="<your steamLoginSecure cookie>"
cmake -B build -DSTEAMWORKS_USE_SDK_MIRROR=OFF
cmake --build buildIf you already have the SDK extracted locally, disable the download step and point CMake at its root:
cmake -B build \
-DSTEAMWORKS_DOWNLOAD_SDK=OFF \
-DSTEAMWORKS_SDK_ROOT=/path/to/steamworks_sdk/sdkSTEAMWORKS_DOWNLOAD_SDK(defaultON): download the SDK automatically.STEAMWORKS_USE_SDK_MIRROR(defaultON): download from the public mirror instead of Steamworks. WhenOFF,STEAM_LOGIN_SECUREmust be set.STEAMWORKS_SDK_ROOT: path to an existing SDK (required whenSTEAMWORKS_DOWNLOAD_SDK=OFF).SWSDK_VERSION(default1.64): Steamworks SDK version to download.
Steamworks::API: the mainsteam_apishared library and headers.Steamworks::EncryptedAppTicket: thesdkencryptedappticketshared library and headers.
- Windows: x86 (32-bit) and x64 (64-bit)
- Linux: x86 (32-bit), x64 (64-bit), and ARM64
- macOS: Universal binary
- Android: ARM64 (arm64-v8a ABI)
SDK documentation can be found here: https://partner.steamgames.com/doc/sdk