diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2017-08-09 19:29:36 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2017-08-09 19:29:36 (GMT) |
commit | 0e8e0e07d6c4bc8c9cd6df5407452c12752ab45c (patch) | |
tree | 61e45e5185d01b464546a18b72490eda7751a73a /googletest | |
parent | ec44c6c1675c25b9827aacd08c02433cccde7780 (diff) | |
download | googletest-0e8e0e07d6c4bc8c9cd6df5407452c12752ab45c.zip googletest-0e8e0e07d6c4bc8c9cd6df5407452c12752ab45c.tar.gz googletest-0e8e0e07d6c4bc8c9cd6df5407452c12752ab45c.tar.bz2 |
Fix library install destinationsrefs/pull/1160/head
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 <d3x0r@users.noreply.github.com>
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index 621d0f0..8d74ad6 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -102,10 +102,14 @@ endif() ######################################################################## # # Install rules -install(TARGETS gtest gtest_main - DESTINATION lib) -install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest - DESTINATION include) +if(INSTALL_GTEST) + install(TARGETS gtest gtest_main + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +endif() ######################################################################## # |