diff --git a/cmake/macros/TargetSteamworks.cmake b/cmake/macros/TargetSteamworks.cmake new file mode 100644 index 0000000000..24752ebd94 --- /dev/null +++ b/cmake/macros/TargetSteamworks.cmake @@ -0,0 +1,12 @@ +# +# Copyright 2015 High Fidelity, Inc. +# Created by Clement Brisset on 6/8/2016 +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# +macro(TARGET_STEAMWORKS) + find_package(Steamworks REQUIRED) + target_include_directories(${TARGET_NAME} PRIVATE ${STEAMWORKS_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${STEAMWORKS_LIBRARIES}) +endmacro() diff --git a/cmake/modules/FindSteamworks.cmake b/cmake/modules/FindSteamworks.cmake new file mode 100644 index 0000000000..a8f00ed335 --- /dev/null +++ b/cmake/modules/FindSteamworks.cmake @@ -0,0 +1,45 @@ +# +# FindSteamworks.cmake +# +# Try to find the Steamworks controller library +# +# This module defines the following variables +# +# STEAMWORKS_FOUND - Was Steamworks found +# STEAMWORKS_INCLUDE_DIRS - the Steamworks include directory +# STEAMWORKS_LIBRARIES - Link this to use Steamworks +# +# This module accepts the following variables +# +# STEAMWORKS_ROOT - Can be set to steamworks install path or Windows build path +# +# Created on 6/8/2016 by Clement Brisset +# Copyright 2016 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +set(STEAMWORKS_POSSIBLE_PATHS "/Users/clement/Downloads/steamworks_sdk_137/") + +find_path(STEAMWORKS_INCLUDE_DIRS + NAMES steam_api.h + PATH_SUFFIXES "public/steam" + PATHS ${STEAMWORKS_POSSIBLE_PATHS} +) + +get_filename_component(STEAMWORKS_INCLUDE_DIR_NAME ${STEAMWORKS_INCLUDE_DIRS} NAME) +if (STEAMWORKS_INCLUDE_DIR_NAME STREQUAL "steam") + get_filename_component(STEAMWORKS_INCLUDE_DIRS ${STEAMWORKS_INCLUDE_DIRS} PATH) +else() + message(STATUS "Include directory not named steam, this will cause issues with include statements") +endif() + +find_library(STEAMWORKS_LIBRARIES + NAMES libsteam_api.dylib + PATH_SUFFIXES "redistributable_bin/osx32" + PATHS ${STEAMWORKS_POSSIBLE_PATHS} +) + + +find_package_handle_standard_args(Steamworks DEFAULT_MSG STEAMWORKS_LIBRARIES STEAMWORKS_INCLUDE_DIRS) \ No newline at end of file diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 4381f3321b..ae84705da3 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -139,7 +139,7 @@ link_hifi_libraries(shared octree gpu gl gpu-gl procedural model render recording fbx networking model-networking entities avatars audio audio-client animation script-engine physics render-utils entities-renderer ui auto-updater - controllers plugins display-plugins input-plugins) + controllers plugins display-plugins input-plugins steamworks-wrapper) # include the binary directory of render-utils for shader includes target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/libraries/render-utils") diff --git a/libraries/steamworks-wrapper/CMakeLists.txt b/libraries/steamworks-wrapper/CMakeLists.txt new file mode 100644 index 0000000000..0cbe3bb5ad --- /dev/null +++ b/libraries/steamworks-wrapper/CMakeLists.txt @@ -0,0 +1,5 @@ +set(TARGET_NAME steamworks-wrapper) +setup_hifi_library() +link_hifi_libraries() + +target_steamworks() \ No newline at end of file diff --git a/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp new file mode 100644 index 0000000000..0f06e03672 --- /dev/null +++ b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp @@ -0,0 +1,19 @@ +// +// SteamClient.cpp +// steamworks-wrapper/src/steamworks-wrapper +// +// Created by Clement Brisset on 6/8/16. +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "SteamClient.h" + +#include + + + + + diff --git a/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.h b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.h new file mode 100644 index 0000000000..369641b0c7 --- /dev/null +++ b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.h @@ -0,0 +1,21 @@ +// +// SteamClient.h +// steamworks-wrapper/src/steamworks-wrapper +// +// Created by Clement Brisset on 6/8/16. +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +#ifndef hifi_SteamClient_h +#define hifi_SteamClient_h + +class SteamClient { + + +}; + +#endif // hifi_SteamClient_h \ No newline at end of file