#[[

╔═════════════════════════════════════════════╗
║    Copyright © 2022 Mykhailo Mushynskyi     ║
╟─────────────────────────────────────────────╢
║  This work is licensed under a MIT License  ║
╚═════════════════════════════════════════════╝

]]

# Source path
set(MythSDK_SrcDir ${CMAKE_CURRENT_LIST_DIR}/Source)

# Core files
set(Core_SrcDir ${MythSDK_SrcDir}/Core)
set(Core_Files
    ${Core_SrcDir}/KrakenStatus.h
    ${Core_SrcDir}/Exception.cpp
    ${Core_SrcDir}/Exception.h
)
if(WIN32)
    list(APPEND Core_Files
        ${Core_SrcDir}/Windows/WinException.cpp
    )
elseif(APPLE)
endif()

# Include files
set(SDK_IncDir ${MythSDK_SrcDir}/Include)
set(SDK_Includes
    ${SDK_IncDir}/WinPrefs.h
)

# Create MythSDK target
add_library(MythSDK ${SDK_Type}
    ${Core_Files}
    ${SDK_Includes}
)
set_target_properties(MythSDK PROPERTIES
    FOLDER MythSDK
)

# Helper function to link SDK
function(include_sdk Target)
    target_link_libraries(${Target} MythSDK)
    target_include_directories(${Target} PRIVATE
        ${Core_SrcDir}
        ${SDK_IncDir}
    )
endfunction()
