-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
33 lines (23 loc) · 879 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
cmake_minimum_required(VERSION 3.14)
project(affx)
option(BUILD_PYTHON "Build python module" ON)
option(USE_INTERNAL_PYBIND11 "Build python module" OFF)
find_package(Eigen3 REQUIRED)
add_library(affx src/affine.cpp)
target_compile_features(affx PUBLIC cxx_std_17)
target_include_directories(affx PUBLIC include)
target_link_libraries(affx PUBLIC Eigen3::Eigen)
add_library(affx::affx ALIAS affx)
if(BUILD_PYTHON)
if(NOT pybind11_FOUND)
if(USE_INTERNAL_PYBIND11)
include(FetchContent)
FetchContent_Declare(pybind11_fetch GIT_REPOSITORY https://github.com/pybind/pybind11.git GIT_TAG v2.6.2)
FetchContent_MakeAvailable(pybind11_fetch)
else()
find_package(pybind11 REQUIRED)
endif()
endif()
pybind11_add_module(pyaffx src/python.cpp)
target_link_libraries(pyaffx PUBLIC affx)
endif()