cmake_minimum_required(VERSION 3.23)
project(Abgabe_Cg_Vis)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# nice program options/flags, and generally useful stuff
find_package(Boost COMPONENTS program_options REQUIRED)


# for reading and wrangling data
find_package(DCMTK REQUIRED)
find_package(OpenCV REQUIRED)


# for rendering
find_package(OpenGL REQUIRED)
find_package(jsoncpp REQUIRED)  # needed by VTK
find_package(
    VTK

    COMPONENTS  # needs to have components specified

    CommonColor
    CommonCore
    CommonDataModel
    InteractionStyle
    InteractionWidgets
    RenderingContextOpenGL2
    RenderingCore
    RenderingFreeType
    RenderingGL2PSOpenGL2
    RenderingOpenGL2
    RenderingVolume
    RenderingVolumeOpenGL2
)

add_executable(
    ${PROJECT_NAME}

    src/main.cpp
    src/options.cpp
    src/options.hpp
    src/dicom.cpp
    src/dicom.hpp
    src/image_stack.cpp
    src/image_stack.hpp
    src/scene.cpp
    src/scene.hpp
    src/convenience.hpp
)

target_link_libraries(
    ${PROJECT_NAME}

    LINK_PUBLIC

    ${Boost_LIBRARIES}
    ${OPENGL_LIBRARIES}
    ${OpenCV_LIBRARIES}
    ${VTK_LIBRARIES}
    ${DCMTK_LIBRARIES}
)

vtk_module_autoinit(
    TARGETS ${PROJECT_NAME}
    MODULES ${VTK_LIBRARIES}
)
