SHARE
TWEET

cmake_list

a guest Jul 16th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 2.8.8)
  2. project(Steam++)
  3.  
  4. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
  5.  
  6. find_package(Protobuf REQUIRED)
  7. find_package(CryptoPP REQUIRED)
  8. find_package(LibArchive REQUIRED)
  9.  
  10. set(STEAMKIT $ENV{SteamRE} CACHE PATH "Where you cloned SteamKit")
  11. set(PROTOBUF_IMPORT_DIRS ${STEAMKIT}/Resources/Protobufs)
  12. PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
  13.     ${PROTOBUF_IMPORT_DIRS}/steamclient/steammessages_clientserver.proto
  14.     ${PROTOBUF_IMPORT_DIRS}/steamclient/steammessages_base.proto
  15.     ${PROTOBUF_IMPORT_DIRS}/steamclient/encrypted_app_ticket.proto
  16. )
  17.  
  18. set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
  19.  
  20. include_directories(
  21.     ${PROTOBUF_INCLUDE_DIRS}
  22.     ${CRYPTOPP_INCLUDE_DIR}
  23.     ${LibArchive_INCLUDE_DIRS}
  24.     ${CMAKE_BINARY_DIR}
  25. )
  26.  
  27. add_library(steam++
  28.     steam++.cpp
  29.     cmclient.cpp
  30.     handlers.cpp
  31.     ${PROTO_SRCS}
  32. )
  33.  
  34. target_link_libraries(steam++
  35.     ${PROTOBUF_LIBRARIES}
  36.     ${CRYPTOPP_LIBRARIES}
  37.     ${LibArchive_LIBRARIES}
  38. )
  39.  
  40.  
  41. # sample project that uses libuv as the event loop
  42. # to be removed when there is a complete example project somewhere
  43.  
  44. find_package(Libuv)
  45. if (LIBUV_FOUND)
  46.     add_executable(steamuv
  47.         steamuv.cpp
  48.     )
  49.    
  50.     include_directories(${LIBUV_INCLUDE_DIR})
  51.    
  52.     target_link_libraries(steamuv
  53.         steam++
  54.         ${LIBUV_LIBRARIES}
  55.     )
  56. endif()
  57.  
  58. if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
  59.     set_target_properties(steam++ PROPERTIES COMPILE_FLAGS "-fPIC")
  60. endif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
  61.  
  62. # libpurple plugin
  63.  
  64. find_library(LIBPURPLE_LIBRARIES purple)
  65. find_path(LIBPURPLE_INCLUDE_DIRS purple.h PATH_SUFFIXES libpurple)
  66. find_package(GLIB)
  67. if (LIBPURPLE_LIBRARIES AND LIBPURPLE_INCLUDE_DIRS AND GLIB_FOUND)
  68.     add_library(steam MODULE
  69.         steampurple.cpp
  70.     )
  71.    
  72.     include_directories(
  73.         ${LIBPURPLE_INCLUDE_DIRS}
  74.         ${GLIB_INCLUDE_DIRS}
  75.     )
  76.    
  77.     target_link_libraries(steam
  78.         steam++
  79.         ${LIBPURPLE_LIBRARIES}
  80.         ${GLIB_LIBRARIES}
  81.     )
  82. endif()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top