-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
78 lines (59 loc) · 1.38 KB
/
Copy pathCMakeLists.txt
File metadata and controls
78 lines (59 loc) · 1.38 KB
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
cmake_minimum_required(VERSION 3.16)
project(aimbot LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Static MSVC runtime
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
# Dependencies
find_package(OpenCV REQUIRED COMPONENTS core imgproc highgui)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(nlohmann_json)
# Target
add_executable(aimbot
src/main.cpp
)
target_include_directories(aimbot PRIVATE
includes
)
target_compile_options(aimbot PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/O2>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-O3>
)
# Link dependencies
target_link_libraries(aimbot PRIVATE
${OpenCV_LIBRARIES}
nlohmann_json::nlohmann_json
)
# Platform-specific
if(WIN32)
target_link_libraries(aimbot PRIVATE
gdi32
user32
comctl32
ws2_32
comdlg32
advapi32
shell32
ole32
oleaut32
)
else()
find_package(X11 REQUIRED)
target_link_libraries(aimbot PRIVATE
${X11_LIBRARIES}
X11::Xext
pthread
)
endif()
install(TARGETS aimbot DESTINATION bin)