forked from welltop-cn/pypag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (23 loc) · 1 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
cmake_minimum_required(VERSION 3.15)
project(pypag LANGUAGES CXX)
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
set(PLATFORM linux)
endif ()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR $CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
set(ARCH x64)
endif ()
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ version selection")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)
find_package(Python COMPONENTS Interpreter Development REQUIRED)
add_subdirectory(pybind11)
set(PAG_PATH libpag)
include_directories(${PAG_PATH}/include)
include_directories(${PAG_PATH}/vendor/ffavc/include)
file(GLOB PYPAG_STATIC_LIBS libs/${PLATFORM}/${ARCH}/*.a)
file(GLOB PYPAG_SHARED_LIBS libs/${PLATFORM}/${ARCH}/*.so)
message(STATUS "PYPAG_SHARED_LIBS=${PYPAG_SHARED_LIBS}")
message(STATUS "PYPAG_STATIC_LIBS=${PYPAG_STATIC_LIBS}")
add_library(pypag MODULE src/cpp/pypag.cpp)
target_link_libraries(pypag PRIVATE ${PYPAG_STATIC_LIBS} ${PYPAG_SHARED_LIBS} pybind11::module pybind11::lto)
pybind11_extension(pypag)
pybind11_strip(pypag)