diff options
author | Brad King <brad.king@kitware.com> | 2020-01-27 14:29:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-27 14:29:10 (GMT) |
commit | e0a288b0ff27905dd77b545a2d62992de420d5f0 (patch) | |
tree | 84f9d2b95578293553fc0bf0f9045fcd9db139f7 /Modules | |
parent | b13a446ed03f0ad76aadcd0c0f744d5dec1df84e (diff) | |
parent | fbd3ea2047bf1a09ff24d9a04078b75438ebd46b (diff) | |
download | CMake-e0a288b0ff27905dd77b545a2d62992de420d5f0.zip CMake-e0a288b0ff27905dd77b545a2d62992de420d5f0.tar.gz CMake-e0a288b0ff27905dd77b545a2d62992de420d5f0.tar.bz2 |
Merge topic 'FindGTest-upstream-lib-names'
fbd3ea2047 FindGTest: Add GTest::{gtest,gtest_main} library names
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4268
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindGTest.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index e015a98..53cab1a 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -240,4 +240,15 @@ if(GTEST_FOUND) __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY "RELEASE") __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY "DEBUG") endif() + + # Add targets mapping the same library names as defined in + # GTest's CMake package config. + if(NOT TARGET GTest::gtest) + add_library(GTest::gtest INTERFACE IMPORTED) + target_link_libraries(GTest::gtest INTERFACE GTest::GTest) + endif() + if(NOT TARGET GTest::gtest_main) + add_library(GTest::gtest_main INTERFACE IMPORTED) + target_link_libraries(GTest::gtest_main INTERFACE GTest::Main) + endif() endif() |