From d0adbc1b8f193e0d0ce3b78eab467e8a9915464b Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sat, 13 Nov 2021 18:24:51 +0000 Subject: [PATCH] Also import GMock::Main Debug library properly --- cmake/FindGMock.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/FindGMock.cmake b/cmake/FindGMock.cmake index 502910a9df..0e98d4e6c0 100644 --- a/cmake/FindGMock.cmake +++ b/cmake/FindGMock.cmake @@ -182,8 +182,16 @@ endif() set_target_properties(GMock::Main PROPERTIES INTERFACE_LINK_LIBRARIES "GMock::GMock" - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARY}") + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") + +if(EXISTS "${GMOCK_MAIN_LIBRARY}") + set_target_properties(GMock::Main PROPERTIES + IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARY}") +endif() +if(EXISTS "${GMOCK_MAIN_LIBRARY_DEBUG}") + set_target_properties(GMock::Main PROPERTIES + IMPORTED_LOCATION "{GMOCK_MAIN_LIBRARY_DEBUG}) +endif() if(GMOCK_FOUND) set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})