cmake_minimum_required(VERSION 3.15)

project(Eigen_Ref CXX)

add_library(EigenRef INTERFACE)

target_include_directories(EigenRef INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(EigenRef INTERFACE eigen_matrix.hpp)

target_include_directories(EigenRef INTERFACE $ENV{Eigen_INCLUDE_DIR})

find_package(AutoPyBind11)
autopybind11_fetch_build_pybind11(PYBIND11_DIR ${PYBIND11_SRC_DIR})


autopybind11_add_module(EigenRefMod
                        YAML_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/wrapper_input.yml
                        DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
                        LINK_LIBRARIES EigenRef
                        )