cmake_minimum_required(VERSION 3.10)
project(angles VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Create interface library (header-only)
add_library(angles INTERFACE)

# Set include directories
target_include_directories(angles INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>
)

# Install headers
install(DIRECTORY include/angles
  DESTINATION include
  FILES_MATCHING PATTERN "*.h"
)

# Install target
install(TARGETS angles
  EXPORT angles-targets
  INCLUDES DESTINATION include
)

# Export targets
install(EXPORT angles-targets
  FILE angles-targets.cmake
  DESTINATION lib/cmake/angles
)

