cmake_minimum_required(VERSION 3.24)
project(EpicTunerHelloPanels LANGUAGES CXX)
find_package(EpicTunerSDK 1.0 REQUIRED CONFIG)
add_library(hello-panels MODULE hello.cpp)
target_link_libraries(hello-panels PRIVATE EpicTuner::SDKCpp)
set_target_properties(hello-panels PROPERTIES PREFIX "" CXX_VISIBILITY_PRESET hidden)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" processor)
if(processor MATCHES "^(arm64|aarch64)$")
    set(ET_ARCH arm64)
elseif(processor MATCHES "^(amd64|x86_64)$")
    set(ET_ARCH x64)
else()
    message(FATAL_ERROR "Unsupported architecture")
endif()
if(WIN32 AND ET_ARCH STREQUAL "x64")
    set(ET_PLATFORM windows-x64)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    set(ET_PLATFORM linux-${ET_ARCH})
else()
    message(FATAL_ERROR "Unsupported preview platform")
endif()
configure_file(plugin.json.in plugin.json @ONLY)
configure_file(epictuner.png assets/epictuner.png COPYONLY)
