[workspace]
channels = ["conda-forge"]
name = "PeriDEM"
platforms = ["linux-64", "osx-arm64"]
version = "v0.2.1"

[tasks.build]
description = "Build PeriDEM from local source"
cmd = """
cmake   -DEnable_Documentation=OFF \
        -DEnable_Tests=ON \
        -DEnable_High_Load_Tests=OFF \
        -DDisable_Docker_MPI_Tests=ON \
        -DVTK_DIR="$CONDA_PREFIX" \
        -DMETIS_DIR="$CONDA_PREFIX" \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
        -S . \
        -B build && \
cmake build -LH && \
cmake --build build --clean-first --parallel "$(nproc --ignore=2)"
"""

[tasks.ctest]
description = "Run tests with ctest"
cmd = "ctest --verbose --test-dir ./build/"

[tasks.install-peridem]
description = "Install PeriDEM under CMAKE_INSTALL_PREFIX defined in build"
cmd = "cmake --install build"

[tasks.start]
description = "Build and install PeriDEM"
depends-on = ["build", "install-peridem"]

[tasks.test]
description = "Do a clean build of PeriDEM and run ctest tests"
depends-on = ["build", "ctest"]

[dependencies]
cxx-compiler = ">=1.11.0,<2"
cmake = ">=4.2.1,<5"
make = ">=4.4.1,<5"
vtk = ">=9.5.2,<10"
yaml-cpp = ">=0.8.0,<0.9"
metis = ">=5.2.1,<6"
openmpi = ">=5.0.8,<6"
gmsh = ">=4.15.0,<5"  # for tests
