From 5ba997ee163f7c9cf02deca08eb90825ab1c38e8 Mon Sep 17 00:00:00 2001 From: Pierre Dejoue Date: Fri, 18 Aug 2023 11:18:58 +0200 Subject: [PATCH] Modify the pfd third party import to prevent a CMake deprecation warning We populate the project portable-file-dialogs and do not use that project's CMakeLists.txt, whose cmake_minimum_required() call generates a deprecation warning on CMake. --- cmake/third_party/pfd.cmake | 11 ++++++++--- src/gui/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/third_party/pfd.cmake b/cmake/third_party/pfd.cmake index 47d1030..ba53616 100644 --- a/cmake/third_party/pfd.cmake +++ b/cmake/third_party/pfd.cmake @@ -10,11 +10,16 @@ FetchContent_Declare( GIT_REPOSITORY https://github.com/samhocevar/portable-file-dialogs.git GIT_TAG 7f852d88a480020d7f91957cbcefe514fc95000c ) -FetchContent_MakeAvailable(pfd) +FetchContent_Populate(pfd) -# To make it visible in the IDE -add_custom_target(pfd SOURCES +add_library(pfd + INTERFACE ${pfd_SOURCE_DIR}/portable-file-dialogs.h ) +target_include_directories(pfd + INTERFACE + ${pfd_SOURCE_DIR} +) + set_property(TARGET pfd PROPERTY FOLDER "third_parties") diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 9fb46a6..16099a8 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -51,7 +51,7 @@ target_link_libraries(picross_solver picross::picross picross::utils imgui - portable_file_dialogs + pfd ) install(TARGETS picross_solver)