mirror of
https://github.com/fmtlib/fmt.git
synced 2026-08-03 20:14:20 +02:00
gtest: move GTest/GMock files to separate directory, update GTest/GMock usages
* all GTest/GMock files moved to `test/gtest` directory * `CMakeLists.txt` created in `test/gtest` from `CMakeLists.txt` in `test` * GTest/GMock target in CMake renamed to `gtest` (was `gmock`) * CMake `gtest` target updated to export includes as "gtest/gtest.h" or "gmock/gmock.h" only * includes in tests updated: "gtest.h" -> "gtest/gtest.h", "gmock.h" -> "gmock/gmock.h" * removed duplications of `target_include_directories` for GTest/GMock directories (CMake manages them)
This commit is contained in:
committed by
Victor Zverovich
parent
342973b349
commit
53ca0cbe75
@@ -0,0 +1,33 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# Build the google test library
|
||||
|
||||
# We compile Google Test ourselves instead of using pre-compiled libraries.
|
||||
# See the Google Test FAQ "Why is it not recommended to install a
|
||||
# pre-compiled copy of Google Test (for example, into /usr/local)?"
|
||||
# at http://code.google.com/p/googletest/wiki/FAQ for more details.
|
||||
add_library(gtest STATIC
|
||||
gmock-gtest-all.cc gmock/gmock.h gtest/gtest.h gtest/gtest-spi.h)
|
||||
target_compile_definitions(gtest PUBLIC GTEST_HAS_STD_WSTRING=1)
|
||||
target_include_directories(gtest SYSTEM PUBLIC .)
|
||||
|
||||
find_package(Threads)
|
||||
if (Threads_FOUND)
|
||||
target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT})
|
||||
else ()
|
||||
target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0)
|
||||
endif ()
|
||||
|
||||
target_compile_definitions(gtest PUBLIC GTEST_LANG_CXX11=1)
|
||||
|
||||
if (MSVC)
|
||||
# Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions.
|
||||
target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Disable MSVC warnings of POSIX functions.
|
||||
target_compile_options(gtest PUBLIC -Wno-deprecated-declarations)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Silence MSVC tr1 deprecation warning in gmock.
|
||||
target_compile_definitions(gtest
|
||||
PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user