cmake_minimum_required(VERSION 3.16)
project(OpenHoopsIFF LANGUAGES CXX)
find_package(ZLIB REQUIRED)
add_library(openhoops_iff iff.cpp texture.cpp)
target_compile_features(openhoops_iff PUBLIC cxx_std_17)
target_include_directories(openhoops_iff PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(openhoops_iff PUBLIC ZLIB::ZLIB)
add_executable(openhoops_iff_inspect ../tools/iff_inspect.cpp)
target_link_libraries(openhoops_iff_inspect PRIVATE openhoops_iff)
add_executable(openhoops_iff_texture ../tools/iff_texture.cpp)
target_link_libraries(openhoops_iff_texture PRIVATE openhoops_iff)
add_library(openhoops_pixels pixels.cpp)
target_link_libraries(openhoops_pixels PUBLIC openhoops_iff)
add_executable(openhoops_iff_pixels ../tools/iff_pixels.cpp)
target_link_libraries(openhoops_iff_pixels PRIVATE openhoops_pixels)
include(CTest)
if(BUILD_TESTING)
    add_executable(openhoops_pixels_test pixels_test.cpp)
    target_link_libraries(openhoops_pixels_test PRIVATE openhoops_pixels)
    add_test(NAME pixels COMMAND openhoops_pixels_test)
endif()
