-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
82 lines (65 loc) · 1.84 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
cmake_minimum_required(VERSION 2.8.8)
project(Steam++)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(Protobuf REQUIRED)
find_package(CryptoPP REQUIRED)
find_package(LibArchive REQUIRED)
set(STEAMKIT $ENV{SteamRE} CACHE PATH "Where you cloned SteamKit")
set(PROTOBUF_IMPORT_DIRS ${STEAMKIT}/Resources/Protobufs)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
${PROTOBUF_IMPORT_DIRS}/steamclient/steammessages_clientserver.proto
${PROTOBUF_IMPORT_DIRS}/steamclient/steammessages_base.proto
${PROTOBUF_IMPORT_DIRS}/steamclient/encrypted_app_ticket.proto
)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
include_directories(
${PROTOBUF_INCLUDE_DIRS}
${CRYPTOPP_INCLUDE_DIR}
${LibArchive_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
)
add_library(steam++
steam++.cpp
cmclient.cpp
handlers.cpp
${PROTO_SRCS}
)
target_link_libraries(steam++
${PROTOBUF_LIBRARIES}
${CRYPTOPP_LIBRARIES}
${LibArchive_LIBRARIES}
)
# sample project that uses libuv as the event loop
# to be removed when there is a complete example project somewhere
find_package(Libuv)
if (LIBUV_FOUND)
add_executable(steamuv
steamuv.cpp
)
include_directories(${LIBUV_INCLUDE_DIR})
target_link_libraries(steamuv
steam++
${LIBUV_LIBRARIES}
)
endif()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set_target_properties(steam++ PROPERTIES COMPILE_FLAGS "-fPIC")
endif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
# libpurple plugin
find_library(LIBPURPLE_LIBRARIES purple)
find_path(LIBPURPLE_INCLUDE_DIRS purple.h PATH_SUFFIXES libpurple)
find_package(GLIB)
if (LIBPURPLE_LIBRARIES AND LIBPURPLE_INCLUDE_DIRS AND GLIB_FOUND)
add_library(steam MODULE
steampurple.cpp
)
include_directories(
${LIBPURPLE_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
)
target_link_libraries(steam
steam++
${LIBPURPLE_LIBRARIES}
${GLIB_LIBRARIES}
)
endif()