-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 1.69 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
cmake_minimum_required(VERSION 3.1)
project("PyPlug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20" CACHE STRING "Comment" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -D NDEBUG" CACHE STRING "Comment" FORCE)
set(CMAKE_CXX_FLAGS_SANITIZER "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -fsanitize=address,undefined -g" CACHE STRING "Comment" FORCE)
# Enable debug symbols by default
# must be done before project() statement
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
# (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)
include(FetchContent)
FetchContent_Declare(
utils
GIT_REPOSITORY https://github.com/Lord-KA/CPPUtils.git
GIT_TAG release-0.1
)
FetchContent_GetProperties(utils)
if(NOT utils_POPULATED)
FetchContent_Populate(utils)
include_directories(${utils_SOURCE_DIR})
endif()
FetchContent_Declare(
commonTools
GIT_REPOSITORY https://github.com/mishaglik/Elpidifor-s-legacy.git
GIT_TAG main
)
FetchContent_GetProperties(commonTools)
if(NOT commonTools_POPULATED)
FetchContent_Populate(commonTools)
include_directories(./build/_deps/commontools-src)
endif()
# Define sources and executable
add_executable(standalone-pyplug ./standalone-pyplug.cpp)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.10.4
)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(./build/_deps/pybind11-src)
endif()
target_link_libraries(standalone-pyplug pybind11::embed)
add_library(pyplug SHARED pyplug.cpp)
target_link_libraries(pyplug pybind11::embed)