From a9877aea984243bc04cf26b80320a7d96c22124f Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sat, 13 Nov 2021 18:19:14 +0000 Subject: [PATCH] Ensure Debug version of GMock library is added to imported target (cherry picked from commit dcf61dfe783fe808c76d102e6639ed0be77d5932) --- cmake/FindGMock.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/FindGMock.cmake b/cmake/FindGMock.cmake index 6b3caf543e..bc3410969f 100644 --- a/cmake/FindGMock.cmake +++ b/cmake/FindGMock.cmake @@ -164,8 +164,16 @@ find_dependency(Threads) set_target_properties(GMock::GMock PROPERTIES INTERFACE_LINK_LIBRARIES "Threads::Threads" - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${GMOCK_LIBRARY}") + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") + +if(EXISTS "${GMOCK_LIBRARY}") + set_target_properties(GMock::GMock PROPERTIES + IMPORTED_LOCATION "${GMOCK_LIBRARY}") +endif() +if(EXISTS "${GMOCK_LIBRARY_DEBUG}") + set_target_properties(GMock::GMock PROPERTIES + IMPORTED_LOCATION_DEBUG "${GMOCK_LIBRARY_DEBUG}") +endif() if(GMOCK_INCLUDE_DIR) set_target_properties(GMock::GMock PROPERTIES