julianxhokaxhiu / SteamworksSDKCI

CI builds of Steamworks SDK for CMake build systems

Home Page:https://partner.steamgames.com/downloads/list

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake integration instructions not clear

sychev opened this issue · comments

Hello! Thank you for the library. I'm trying to include it to my project.
In my CMakeLists.txt I have

set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    ${CMAKE_CURRENT_SOURCE_DIR}/SteamworksSDKCI/cmake
)

add_subdirectory(SteamworksSDKCI/cmake)
include_directories(SteamworksSDKCI/steamworks_sdk/public/steam)

find_package(STEAMWORKSSDK REQUIRED)

target_link_libraries(main STEAMWORKSSDK::STEAMWORKSSDK)

But I have an error message

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find STEAMWORKSSDK (missing: STEAMWORKSSDK_LIBRARY
  STEAMWORKSSDK_APPTICKET_LIBRARY)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  SteamworksSDKCI/cmake/FindSteamworksSDK.cmake:54 (find_package_handle_standard_args)
  CMakeLists.txt:56 (find_package)

Could you check FindSteamworksSDK.cmake? Thank you in advance!

Hi, I'm pretty sure it works because I tested it personally not that long ago.

But looking at your own definition of CMAKE_MODULE_PATH I fear you might have got the syntax wrong. Should be instead:

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/SteamworksSDKCI/cmake")

Most probably your CMake installation is not able to locate the FindSteamworksSDK.cmake file. Also make sure to set that BEFORE the project() CMake call.

Let me know how it goes!

//EDIT1: Forgot to mention that the error might also be related to CMake not being able to actually find your library file in the disk. Make sure it's located in the known CMake lookup lib paths.

//EDIT2: Simple snippet for you

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SteamworksSDKCI)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/SteamworksSDKCI)

Assuming that ${CMAKE_CURRENT_SOURCE_DIR}/SteamworksSDKCI will contain the extracted ZIP content of either x86 or x64 release.

Julian, that was a insanely fast response! Thank you.
I've tried to build it with your instructions, but outcome is the same.
I'm trying to create a portable build across Windows, Mac and Linux. Here is the repository for my project
https://github.com/sychev/opengl-glfw
I've managed to add a few libraries so far, but I'm stuck with SteamworksSDK.
My setup:
Windows — MinGW-64
Mac — gcc
Linux — gcc
I've changed CMAKE_MODULE_PATH definition, but result is the same. I've tried (not sure it was necessary) to build my project on Mac OS and Linux, and the thing is Mac OS and Windows has the same problem.

-- Using Cocoa for window creation
CMake Error at /usr/local/Cellar/cmake/3.21.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find STEAMWORKSSDK (missing: STEAMWORKSSDK_LIBRARY
  STEAMWORKSSDK_APPTICKET_LIBRARY STEAMWORKSSDK_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  SteamworksSDKCI/cmake/FindSTEAMWORKSSDK.cmake:54 (find_package_handle_standard_args)
  CMakeLists.txt:52 (find_package)

I don't know what's wrong here, maybe it's because I'm creating build in neighbor directory with -build.win64 suffix. If I solve it, I will definitely post a solution here and I will update repository
https://github.com/sychev/opengl-glfw

Thank you for your help.

Julian, that was a insanely fast response! Thank you.

Welcome, no worries :)

I've tried to build it with your instructions, but outcome is the same.

Upon checking your repository I noticed you're using the steamworkssdk/steamworks_sdk/redistributable_bin/win64 folder as link_directory but the Find cmake file I'm providing is not meant to be used against this repository, but against the artifacts you can find on Release.

Therefore if you want to have the Find to work against the repository folder, then you might need to hack your own way around it. Sorry.

Cheers!