cmake_minimum_required(VERSION 3.15)

# Top-level build for Cire.
# Builds the C++ core, the demo, the C++ test binary, and (optionally) the
# pybind11 Python module. Most users will just use the python/ subdir's
# pyproject.toml with `pip install -e .`, which drives scikit-build-core
# and uses cpp/CMakeLists.txt directly.
project(cire
    VERSION 0.2.4
    DESCRIPTION "Cire — multi-language NLP keyword extraction"
    LANGUAGES CXX)

option(CIRE_BUILD_PYTHON "Build the pybind11 Python module" OFF)

add_subdirectory(cpp)

# Move the pybind11 module to python/cire/ so the Python package layout works
# even with this top-level build.
if(CIRE_BUILD_PYTHON)
    set_target_properties(cire_native PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/python/cire
        RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/python/cire
    )
endif()
