forked from fl0werD/mhooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (42 loc) · 1.72 KB
/
CMakeLists.txt
File metadata and controls
51 lines (42 loc) · 1.72 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
#-------------------------------------------------------------------------------------------
#
# To use this library, add the following code to your CMakeLists.txt:
#
# add_subdirectory("path/to/mhooks/directory")
# target_link_libraries(${PROJECT_NAME} PRIVATE mhooks)
#
# Dependencies:
# https://gitlab.com/goldsrc-sdk/cssdk.git
# https://gitlab.com/goldsrc-sdk/core.git
#
# Optional dependencies:
# https://gitlab.com/goldsrc-sdk/amxx.git
# https://gitlab.com/goldsrc-sdk/metamod.git
#
#-------------------------------------------------------------------------------------------
# Minimum required version of CMake for a project
cmake_minimum_required(VERSION 3.20)
# Declare project
project("mhooks")
# Add a library target to be built from the source files
add_library(${PROJECT_NAME} INTERFACE)
# Link dependencies
target_link_libraries(${PROJECT_NAME} INTERFACE "cssdk")
target_link_libraries(${PROJECT_NAME} INTERFACE "core")
# Add include directories to a target
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE "include")
# Find header and source files
file(GLOB_RECURSE MHOOKS_PUBLIC_HEADERS CONFIGURE_DEPENDS "include/*.h")
file(GLOB_RECURSE MHOOKS_PRIVATE_HEADERS CONFIGURE_DEPENDS "src/*.h")
file(GLOB_RECURSE MHOOKS_SOURCES CONFIGURE_DEPENDS "src/*.cpp")
# Add header and source files to target sources list
target_sources(${PROJECT_NAME} INTERFACE
${MHOOKS_PUBLIC_HEADERS}
${MHOOKS_PRIVATE_HEADERS}
${MHOOKS_SOURCES}
)
# Add compile definitions to a target
target_compile_definitions(${PROJECT_NAME} INTERFACE HAS_MHOOKS_LIB)
# Specify the required C and C++ standard
target_compile_features(${PROJECT_NAME} INTERFACE c_std_11)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)