From 0e8e0e07d6c4bc8c9cd6df5407452c12752ab45c Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 9 Aug 2017 15:29:36 -0400 Subject: Fix library install destinations Modify library install destinations to install .dll's to the correct location (`bin`, not `lib`), and to install other artifacts to the correct platform-dependent location by using GNUInstallDirs. This is required for some distributions (e.g. Fedora) and will fix an issue that otherwise requires those distributions to patch the upstream sources. Also, add options to suppress installation, which may be useful for projects that embed Google Test. Since Google Test is trying to support archaic versions of CMake, a brain-dead fallback (which requires that the user set either LIB_SUFFIX or CMAKE_INSTALL_LIBDIR themselves) is included for versions that predate GNUInstallDirs. Fixes #1161. Co-Authored-By: d3x0r --- googlemock/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'googlemock') diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index beb259a2..a0f9430e 100644 --- a/googlemock/CMakeLists.txt +++ b/googlemock/CMakeLists.txt @@ -103,10 +103,14 @@ endif() ######################################################################## # # Install rules -install(TARGETS gmock gmock_main - DESTINATION lib) -install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock - DESTINATION include) +if(INSTALL_GMOCK) + install(TARGETS gmock gmock_main + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +endif() ######################################################################## # -- cgit v1.2.3