From 3e07a8f6fe9a4add0f16913629b0cb4baf672519 Mon Sep 17 00:00:00 2001 From: Alessandro Foresi Date: Sat, 23 Nov 2024 14:36:15 +0100 Subject: [PATCH] Fix CMake build on Windows' PDCurses Static linking only --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e9e2dcc0641c..f79092d0e8b92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -317,6 +317,20 @@ if (CURSES) if (WIN32 AND VCPKG_MANIFEST_MODE) find_package(unofficial-pdcurses CONFIG) if(TARGET unofficial::pdcurses::pdcurses) + get_target_property(_IMPORTED_CONFIGURATIONS unofficial::pdcurses::pdcurses + IMPORTED_CONFIGURATIONS + ) + message(YYY${_IMPORTED_CONFIGURATIONS}) + if (RELEASE AND "Release" IN_LIST _IMPORTED_CONFIGURATIONS) + get_target_property(_IMPORTED_LOCATION unofficial::pdcurses::pdcurses + IMPORTED_IMPLIB_RELEASE) + elseif("Debug" IN_LIST _IMPORTED_CONFIGURATIONS) + get_target_property(_IMPORTED_LOCATION unofficial::pdcurses::pdcurses + IMPORTED_IMPLIB_DEBUG) + endif() + message(XXX${_IMPORTED_LOCATION}) + set_target_properties(unofficial::pdcurses::pdcurses PROPERTIES + IMPORTED_LOCATION ${_IMPORTED_LOCATION}) set(USE_PDCURSES TRUE) endif() elseif(MSYS2)