-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (46 loc) · 1.16 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
cmake_minimum_required(VERSION 3.25...3.30)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C)
add_subdirectory(ta-lib)
find_package(
Python
COMPONENTS Interpreter Development.Module NumPy
REQUIRED
)
find_package(Cython)
include(UseCython)
message(STATUS "Transpiling cython")
cython_transpile(
"${CMAKE_CURRENT_SOURCE_DIR}/src/talib/_ta_lib.pyx"
LANGUAGE C
OUTPUT_VARIABLE _ta_lib_c
CYTHON_ARGS -I "${VCPKG_ROOT}/include"
)
message(STATUS "Creating python library")
python_add_library(
_ta_lib
MODULE
"${_ta_lib_c}"
WITH_SOABI
)
message(STATUS "Linking python library to TALib")
target_link_libraries(
_ta_lib
PUBLIC
ta_lib_static
)
target_include_directories(
_ta_lib
SYSTEM
BEFORE
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/ta-lib/include
${Python_NumPy_INCLUDE_DIRS}
)
install(TARGETS _ta_lib DESTINATION talib/)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/talib/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/src/talib/abstract.py
${CMAKE_CURRENT_SOURCE_DIR}/src/talib/deprecated.py
${CMAKE_CURRENT_SOURCE_DIR}/src/talib/stream.py
DESTINATION talib/
)