#!/bin/bash
set -eu
cp -v asakusa.exr test_tinyexr.cc "$AUTOPKGTEST_TMP"
cat >"$AUTOPKGTEST_TMP/CMakeLists.txt" << EOF
cmake_minimum_required(VERSION 3.31)
project(test_tinyexr)
find_package(tinyexr REQUIRED)
add_executable(test_tinyexr test_tinyexr.cc)
target_link_libraries(test_tinyexr PRIVATE tinyexr::tinyexr)
EOF

cd "$AUTOPKGTEST_TMP"
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make VERBOSE=ON
./test_tinyexr ../asakusa.exr
