cmake_minimum_required(VERSION 3.10)
project(SealProcessing)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/extract_seal_main)
include_directories(${CMAKE_SOURCE_DIR}/remove_border)

set(COMMON_SOURCES
    common.cpp
    image_utilities.cpp
)

set(EXTRACT_SEAL_SOURCES
    extract_seal_main/hsv_color.cpp
    extract_seal_main/image_morphology.cpp
    extract_seal_main/adjust_image.cpp
    extract_seal_main/color_filter.cpp
    extract_seal_main/extract_seal_main.cpp
)

set(REMOVE_BORDER_SOURCES
    remove_border/remove_border.cpp
    remove_border/remove_border_main.cpp
)

add_library(seal_lib STATIC
    ${COMMON_SOURCES}
    ${EXTRACT_SEAL_SOURCES}
    ${REMOVE_BORDER_SOURCES}
)
target_link_libraries(seal_lib ${OpenCV_LIBS})

add_executable(test_extract_seal extract_seal_main/test_extract_seal.cpp)
target_link_libraries(test_extract_seal seal_lib ${OpenCV_LIBS})

add_executable(test_remove_border remove_border/test_remove_border.cpp)
target_link_libraries(test_remove_border seal_lib ${OpenCV_LIBS})
