# just manual: https://github.com/casey/just/#readme

set shell := ['nu', '-c']
set positional-arguments
set dotenv-load
set export

# Provide help
_default:
    @{{just_executable()}} -f {{justfile()}} --list --unsorted

# Export non-standard conan packages
export:
    conan export {{justfile_directory()}}/conan/recipes/opencv --version 4.7.0

# Configure the example application
config:
	cmake -B {{justfile_directory()}}/build \
		  -S {{justfile_directory()}} \
		  -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES={{justfile_directory()}}/conan/conan_provider.cmake \
		  -DCMAKE_BUILD_TYPE=Release

# Build the example application
build:
	cmake --build {{justfile_directory()}}/build --config Release

# Test the example
test:
    cd {{justfile_directory()}}/build; ./example

# Clean the build folder
clean:
	rm -rf {{justfile_directory()}}/build

# Show the platform information
@show:
    ("date:   \"" + (date now | format date "%Y-%m-%d %H:%M:%S") + "\"") | print; \
    ("host:   \"" + (sys | get host.name) + " " + (sys | get host.os_version) + "\"") | print; \
    ("os:     {{os()}}") | print; \
    ("arch:   {{arch()}}") | print; \
    ("conan:  " + (conan --version | str substring 14..)) | print; \
    ("just:   " + (just --version | str substring 5..)) | print; \
    ("nu:     " + (nu --version)) | print; \
    ("-------------------------") | print; \
    open --raw (conan profile path default)