From 9e8fc4313fdaebedb6a7768beeadbf4939c105bc Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:24:07 +0200 Subject: [PATCH] Add build option for QtApng to CMake file --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fabdcf..2788152 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) option(AO_BUILD_TESTS "Build test programs" ON) option(AO_ENABLE_DISCORD_RPC "Enable Discord Rich Presence" ON) +option(AO_BUILD_QTAPNG_IMAGEPLUGIN "Enable APNG Imageplugin" ON) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Network Widgets Concurrent WebSockets UiTools) @@ -128,6 +129,17 @@ if(AO_BUILD_TESTS) add_subdirectory(test) endif() +if (AO_BUILD_QTAPNG_IMAGEPLUGIN) + include(FetchContent) + FetchContent_Declare( + QtApng + GIT_REPOSITORY https://github.com/jurplel/QtApng.git + GIT_TAG master + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/QtApng + ) + FetchContent_MakeAvailable(QtApng) +endif() + set_target_properties(Attorney_Online PROPERTIES LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_LIST_DIR}/bin> RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_CURRENT_LIST_DIR}/bin>)