#!/bin/sh
set -e

cd "$AUTOPKGTEST_TMP"

cat << 'EOF' > CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(cdt_test CXX)
find_package(CDT REQUIRED CONFIG)
add_executable(test_cdt main.cpp)
target_link_libraries(test_cdt PRIVATE CDT::CDT)
EOF

cat << 'EOF' > main.cpp
#include <CDT.h>
int main() {
    CDT::Triangulation<double> cdt;
    return 0;
}
EOF

cmake -B build
cmake --build build
./build/test_cdt
