cmake_minimum_required(VERSION 3.23)
project(GlGeomShapes VERSION 1.4
  LANGUAGES CXX)
include(GNUInstallDirs)

cmake_pkg_config(EXTRACT glew REQUIRED)
message(STATUS "glew libraries ${CMAKE_PKG_CONFIG_LIBS}")
set(SOURCES GlGeomBase.cpp
  GlGeomBezier.cpp
  GlGeomCone.cpp
  GlGeomCube.cpp
  GlGeomCylinder.cpp
  GlGeomSphere.cpp
  GlGeomTeapot.cpp
  GlGeomTorus.cpp
  LinearR3.cpp)
set(HEADERS GlGeomBase.h
  GlGeomBezier.h
  GlGeomCone.h
  GlGeomCube.h
  GlGeomCylinder.h
  GlGeomSphere.h
  GlGeomTeapot.h
  LinearR3.h
  GlGeomTorus.h)

add_library(GlGeomShapes)
add_library(GlGeomShapes::GlGeomShapes ALIAS GlGeomShapes)
target_link_libraries(GlGeomShapes ${CMAKE_PKG_CONFIG_LIBS})
target_sources(GlGeomShapes
  PRIVATE ${SOURCES}
  PUBLIC
  FILE_SET HEADERS TYPE HEADERS
  FILES ${HEADERS})


install(TARGETS GlGeomShapes
  EXPORT GlGeomShapesTargets
  FILE_SET HEADERS DESTINATION include/glgeomshapes)

install(EXPORT GlGeomShapesTargets
  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/GlGeomShapes
  NAMESPACE GlGeomShapes::)

install(FILES)
