This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
77 lines (62 loc) · 2.97 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
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
cmake_policy(SET CMP0042 NEW)
project(LeagueGameReader LANGUAGES CXX)
option(LeagueGameReader_RemoteSettings "Build LeagueGameReader with remote settings support" ON)
option(LeagueGameReader_Python "Build LeagueGameReader bindings for Python" OFF)
option(LeagueGameReader_NodeJS "Build LeagueGameReader bindings for NodeJS" OFF)
option(LeagueGameReader_Example "Build LeagueGameReader example for C++" OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
function(ADD_SRC var folder inc src)
source_group(${folder} FILES ${inc} ${src})
set(${var} ${${var}} ${inc} ${src} CACHE INTERNAL "")
endfunction(ADD_SRC)
set(LGR_SRC "" CACHE INTERNAL "LeagueGameReader Source Files")
# Public general stuff
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader.hpp" "")
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader/types.hpp" "")
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader/library.hpp" "src/library.cpp")
# Public types
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader/game_object.hpp" "")
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader/game_object_manager.hpp" "")
ADD_SRC(LGR_SRC "Library" "inc/league_gamereader/general_items.hpp" "")
# Private stuff
ADD_SRC(LGR_SRC "Reader" "src/game_reader.hpp" "src/game_reader.cpp")
ADD_SRC(LGR_SRC "Process" "src/process.hpp" "src/process.cpp")
ADD_SRC(LGR_SRC "Settings" "src/settings.hpp" "src/settings.cpp")
ADD_SRC(LGR_SRC "\\" "" "swig/swig.i")
add_library(LeagueGameReader ${LGR_SRC})
target_include_directories(LeagueGameReader PUBLIC inc)
target_include_directories(LeagueGameReader PRIVATE src)
if (LeagueGameReader_RemoteSettings)
target_compile_definitions(LeagueGameReader PUBLIC LGR_REMOTE_SETTINGS)
endif ()
if (WIN32)
target_compile_definitions(LeagueGameReader PUBLIC WIN32_LEAN_AND_MEAN)
target_compile_definitions(LeagueGameReader PUBLIC NOMINMAX)
endif ()
if (LeagueGameReader_NodeJS OR LeagueGameReader_Python)
add_subdirectory(swig)
endif ()
set_target_properties(LeagueGameReader PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
CXX_STANDARD 20
CXX_EXTENSIONS OFF)
# Example source code
if (LeagueGameReader_Example)
set(LGR_EXAMPLE_SRC "" CACHE INTERNAL "LeagueGameReader Source Files")
ADD_SRC(LGR_EXAMPLE_SRC "\\" "" "src/example.cpp")
add_executable(LeagueGameReaderExample ${LGR_EXAMPLE_SRC})
target_include_directories(LeagueGameReaderExample PUBLIC inc)
target_link_libraries(LeagueGameReaderExample LeagueGameReader)
if (WIN32)
target_compile_definitions(LeagueGameReaderExample PUBLIC WIN32_LEAN_AND_MEAN)
target_compile_definitions(LeagueGameReaderExample PUBLIC NOMINMAX)
endif ()
set_target_properties(LeagueGameReaderExample PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
CXX_STANDARD 20
CXX_EXTENSIONS OFF
)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT LeagueGameReaderExample)
endif ()