cmake_minimum_required(VERSION 3.20)

project(webcam LANGUAGES CXX)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
endif()

add_library(webcam SHARED
    ./source/webcam.cpp
    ./source/webcam_binding.cpp
    ./source/webcam_impl.cpp
)

# Nom de sortie
set_target_properties(webcam PROPERTIES
    OUTPUT_NAME "webcam_binding"
)

target_include_directories(webcam PRIVATE
    ./include/modules
    ./include/platform
    ./include/engine
    ./include/framework
    ./include
    ./include/squirrel
    ./include/squirrel/include
    ./source
)

target_compile_definitions(webcam PRIVATE
    __PLATFORM_WINDOWS__
    WIN32
    _USRDLL
    _GS_DLL_EXPORT
)

target_link_directories(webcam PRIVATE ./lib)

target_link_libraries(webcam PRIVATE
    modules
    platform
    engine
    framework
    opencv_world300
    extern

    Ws2_32
    Winmm
    dxguid
    dinput8
    wininet

    wldap32
)