project(BaseClasses)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Source files (from the .vcxproj)
set(BASECLASSES_SOURCES
    amextra.cpp
    amfilter.cpp
    amvideo.cpp
    arithutil.cpp
    combase.cpp
    cprop.cpp
    ctlutil.cpp
    ddmm.cpp
    dllentry.cpp
    dllsetup.cpp
    mtype.cpp
    outputq.cpp
    perflog.cpp
    pstream.cpp
    pullpin.cpp
    refclock.cpp
    renbase.cpp
    schedule.cpp
    seekpt.cpp
    source.cpp
    strmctl.cpp
    sysclock.cpp
    transfrm.cpp
    transip.cpp
    videoctl.cpp
    vtrans.cpp
    winctrl.cpp
    winutil.cpp
    wxdebug.cpp
    wxlist.cpp
    wxutil.cpp
)

# Header files
set(BASECLASSES_HEADERS
    amextra.h
    amfilter.h
    cache.h
    combase.h
    cprop.h
    ctlutil.h
    ddmm.h
    dllsetup.h
    dxmperf.h
    fourcc.h
    measure.h
    msgthrd.h
    mtype.h
    outputq.h
    perflog.h
    perfstruct.h
    pstream.h
    pullpin.h
    refclock.h
    reftime.h
    renbase.h
    schedule.h
    seekpt.h
    source.h
    streams.h
    strmctl.h
    sysclock.h
    transfrm.h
    transip.h
    videoctl.h
    vtrans.h
    winctrl.h
    winutil.h
    wxdebug.h
    wxlist.h
    wxutil.h
)

# Create static library
add_library(${PROJECT_NAME} STATIC
    ${BASECLASSES_SOURCES}
    ${BASECLASSES_HEADERS}
)

# Include directories
target_include_directories(${PROJECT_NAME}
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
)

# Link libraries (from .vcxproj)
target_link_libraries(${PROJECT_NAME}
    PUBLIC
        strmiids
)

# Compiler definitions (from .vcxproj)
target_compile_definitions(${PROJECT_NAME}
    PRIVATE
        WIN32
        $<$<CONFIG:Debug>:_DEBUG>
        $<$<CONFIG:Release>:NDEBUG>
        _LIB
)

# Set output names based on configuration (from .vcxproj)
set_target_properties(${PROJECT_NAME}
    PROPERTIES
    DEBUG_POSTFIX "d"
    OUTPUT_NAME "strmbase"
)