cmake_minimum_required(VERSION 3.15)
project(nnflow_backend LANGUAGES CXX)

# Force standard required for modern pybind11
set(CMAKE_CXX_STANDARD 14) 
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find pybind11 (resolved automatically by uv and scikit-build-core)
find_package(pybind11 CONFIG REQUIRED)

# Include your header file directory
include_directories(include layers)

# Compile your main binding file and the underlying batchnorm logic together
pybind11_add_module(_core 
    nnflow/main.cpp
)

# Crucial: Install the binary directly into the flat python folder
install(TARGETS _core DESTINATION nnflow)