gz_get_libsources_and_unittests(sources gtest_sources)

gz_add_component(graphics SOURCES ${sources} GET_TARGET_NAME graphics_target)

target_link_libraries(${graphics_target}
  PUBLIC
    gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
    gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
  PRIVATE
    ${GzAssimp_LIBRARIES}
    FreeImage::FreeImage
    TINYXML2::TINYXML2
)

# CDT does a few float comparisons that cause warnings
target_compile_options(${graphics_target} PRIVATE
    $<$<CXX_COMPILER_ID:GNU>:   -Wno-switch-default -Wno-float-equal>   # GCC
    $<$<CXX_COMPILER_ID:Clang>: -Wno-switch-default -Wno-float-equal>   # Clang
)

gz_build_tests(
  TYPE UNIT
  SOURCES ${gtest_sources}
  LIB_DEPS
    ${graphics_target}
    gz-common${GZ_COMMON_VER}-testing
    TINYXML2::TINYXML2
)
