cmake_minimum_required(VERSION 3.14)
project(ares_pdf_protected_desktop LANGUAGES CXX)
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8 OR CMAKE_GENERATOR_PLATFORM MATCHES "ARM" OR FLUTTER_TARGET_PLATFORM STREQUAL "windows-arm64")
  message(FATAL_ERROR "This local preview contains Windows x64 only.")
endif()
set(PLUGIN_NAME ares_pdf_protected_desktop_plugin)
add_library(${PLUGIN_NAME} SHARED ares_pdf_protected_desktop_plugin_c_api.cpp)
apply_standard_settings(${PLUGIN_NAME})
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL _WIN32_WINNT=0x0A00)
target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
set(ares_pdf_protected_desktop_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/ares_pdf_protected_windows.dll"
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/libares_pdf_core.dll"
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/pdfium.dll" PARENT_SCOPE)
