-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
34 lines (30 loc) · 1015 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
cmake_minimum_required(VERSION 3.26...3.28)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)
find_package(
Python
COMPONENTS Interpreter Development.SABIModule
REQUIRED)
add_custom_command(
OUTPUT dps.cpp
COMMENT
"Making ${CMAKE_CURRENT_BINARY_DIR}/dps.cpp from ${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder/dps.pyx"
COMMAND
Python::Interpreter -m cython
"${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder/dps.pyx" --output-file dps.cpp
DEPENDS mddatasetbuilder/dps.pyx
VERBATIM)
python_add_library(
dps
MODULE
USE_SABI
3.7
${CMAKE_CURRENT_BINARY_DIR}/dps.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder/c_stack.cpp
WITH_SOABI)
target_include_directories(dps
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder)
target_compile_definitions(dps PRIVATE CYTHON_LIMITED_API=1)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(dps PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
endif()
install(TARGETS dps DESTINATION mddatasetbuilder/)