#!/bin/sh
# Build a small program against libarcus-dev, exercising both the legacy
# upper-case (Arcus) and the new lower-case (arcus::arcus) CMake packages.
set -e

cat > test.cpp <<'EOF'
#include <Arcus/Socket.h>

int main()
{
    Arcus::Socket socket;
    (void)socket;
    return 0;
}
EOF

cat > CMakeLists.txt <<'EOF'
cmake_minimum_required(VERSION 3.20)
project(arcus-test CXX)

find_package(Arcus REQUIRED)
find_package(arcus REQUIRED)

add_executable(test-upper test.cpp)
target_link_libraries(test-upper PRIVATE Arcus)

add_executable(test-lower test.cpp)
target_link_libraries(test-lower PRIVATE arcus::arcus)
EOF

cmake -S . -B _build
cmake --build _build


./_build/test-upper
./_build/test-lower
