-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (44 loc) · 1.15 KB
/
CMakeLists.txt
File metadata and controls
52 lines (44 loc) · 1.15 KB
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
cmake_minimum_required(VERSION 3.15)
project(napypi LANGUAGES CXX)
# -------------------------
# Dependencies
# -------------------------
find_package(pybind11 CONFIG REQUIRED)
find_package(OpenMP REQUIRED)
# -------------------------
# Python extension
# -------------------------
pybind11_add_module(_core
src/napy.cpp
src/anova.cpp
src/chi2.cpp
src/kruskal.cpp
src/matrix.cpp
src/mwu.cpp
src/pearson.cpp
src/spearman.cpp
src/ttest.cpp
)
target_compile_features(_core PRIVATE cxx_std_17)
# Project headers
target_include_directories(_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Eigen (vendored, header-only)
target_include_directories(_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen
)
# Boost (vendored, header-only)
target_include_directories(_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/third_party/boost
)
# OpenMP
if(OpenMP_CXX_FOUND)
target_link_libraries(_core PRIVATE OpenMP::OpenMP_CXX)
else()
message(FATAL_ERROR "OpenMP required but not found!")
endif()
# Install location inside Python package
install(TARGETS _core
LIBRARY DESTINATION napypi
RUNTIME DESTINATION napypi)