cmake_minimum_required(VERSION 3.13)
project(ares_pdf_protected_desktop LANGUAGES CXX)
if(NOT FLUTTER_TARGET_PLATFORM STREQUAL "linux-x64")
  message(FATAL_ERROR "This local preview contains Linux x64 only; ARM64 Flutter acceptance is pending.")
endif()
set(PLUGIN_NAME ares_pdf_protected_desktop_plugin)
add_library(${PLUGIN_NAME} SHARED ares_pdf_protected_desktop_plugin.cc)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden BUILD_RPATH "$ORIGIN" INSTALL_RPATH "$ORIGIN")
target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
add_library(ares_pdf_compiled SHARED IMPORTED)
set_target_properties(ares_pdf_compiled PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/libares_pdf_protected_desktop.so")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter PkgConfig::GTK ares_pdf_compiled)
set(ares_pdf_protected_desktop_bundled_libraries
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/libares_pdf_protected_desktop.so"
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/libares_pdf_core.so"
  "${CMAKE_CURRENT_SOURCE_DIR}/binaries/x64/libpdfium.so" PARENT_SCOPE)
