Mercurial > minori
comparison dep/fmt/test/gtest/CMakeLists.txt @ 343:1faa72660932
*: transfer back to cmake from autotools
autotools just made lots of things more complicated than
they should have and many things broke (i.e. translations)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Thu, 20 Jun 2024 05:56:06 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
342:adb79bdde329 | 343:1faa72660932 |
---|---|
1 #------------------------------------------------------------------------------ | |
2 # Build the google test library | |
3 | |
4 # We compile Google Test ourselves instead of using pre-compiled libraries. | |
5 # See the Google Test FAQ "Why is it not recommended to install a | |
6 # pre-compiled copy of Google Test (for example, into /usr/local)?" | |
7 # at http://code.google.com/p/googletest/wiki/FAQ for more details. | |
8 add_library(gtest STATIC | |
9 gmock-gtest-all.cc gmock/gmock.h gtest/gtest.h gtest/gtest-spi.h) | |
10 target_compile_definitions(gtest PUBLIC GTEST_HAS_STD_WSTRING=1) | |
11 target_include_directories(gtest SYSTEM PUBLIC .) | |
12 target_compile_features(gtest PUBLIC cxx_std_11) | |
13 | |
14 find_package(Threads) | |
15 if (Threads_FOUND) | |
16 target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT}) | |
17 else () | |
18 target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0) | |
19 endif () | |
20 | |
21 if (MSVC) | |
22 # Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions. | |
23 target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS) | |
24 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
25 # Disable MSVC warnings of POSIX functions. | |
26 target_compile_options(gtest PUBLIC -Wno-deprecated-declarations) | |
27 endif () | |
28 endif () | |
29 | |
30 # Silence MSVC tr1 deprecation warning in gmock. | |
31 target_compile_definitions(gtest | |
32 PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1) |