diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in index 23c67b5c..0f469857 100644 --- a/googlemock/cmake/gmock.pc.in +++ b/googlemock/cmake/gmock.pc.in @@ -6,5 +6,5 @@ Description: GoogleMock (without main() function) Version: @PROJECT_VERSION@ URL: https://github.com/google/googletest Requires: gtest = @PROJECT_VERSION@ -Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ +Libs: -L${libdir} -lgmock@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@ Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in index b4148fae..225bba81 100644 --- a/googletest/cmake/gtest.pc.in +++ b/googletest/cmake/gtest.pc.in @@ -5,5 +5,5 @@ Name: gtest Description: GoogleTest (without main() function) Version: @PROJECT_VERSION@ URL: https://github.com/google/googletest -Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ +Libs: -L${libdir} -lgtest@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@ Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 7ca256a7..2c75cfb6 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -324,6 +324,9 @@ function(install_project) # Configure and install pkgconfig files. foreach(t ${ARGN}) set(configured_pc "${generated_dir}/${t}.pc") + if(CMAKE_BUILD_TYPE MATCHES Debug) + set(DEBUG_POSTFIX "d") + endif() configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in" "${configured_pc}" @ONLY) install(FILES "${configured_pc}"