-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
40 lines (33 loc) · 984 Bytes
/
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
cmake_minimum_required(VERSION 3.18)
set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(EXTERN_DIR ${ROOT_DIR}/Extern)
set(SCRIPTS_DIR ${ROOT_DIR}/CMake)
set(SAMPLE_PLUGINS_DIR ${ROOT_DIR}/Samples)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)
project(Source2Py LANGUAGES CXX)
include("${SCRIPTS_DIR}/Python.cmake")
include("${SCRIPTS_DIR}/Source2SDK.cmake")
include("${SCRIPTS_DIR}/Metamod.cmake")
file(GLOB SOURCE2PY_SRCS
"Source2Py/src/*.cpp"
"Source2Py/src/*.h"
)
add_library(Source2Py SHARED ${SOURCE2PY_SRCS})
target_include_directories(Source2Py PRIVATE
${SOURCE2SDK_INCLUDE_DIRS}
${METAMOD_INCLUDE_DIRS}
${EXTERN_DIR}/pybind11/include
${Python3_INCLUDE_DIRS}
)
target_link_libraries(Source2Py PRIVATE
Source2SDK
Metamod
${Python3_LIBRARIES}
)
set_target_properties(Source2Py PROPERTIES
OUTPUT_NAME "Source2Py"
PREFIX ""
)
include("${SCRIPTS_DIR}/Package.cmake")