1########################################################################
2# Experimental CMake build script for Google Test.
3#
4# Consider this a prototype.  It will change drastically.  For now,
5# this is only for people on the cutting edge.
6#
7# To run the tests for Google Test itself on Linux, use 'make test' or
8# ctest.  You can select which tests to run using 'ctest -R regex'.
9# For more options, run 'ctest --help'.
10########################################################################
11#
12# Project-wide settings
13
14# Where gtest's .h files can be found.
15include_directories(
16  googletest/include
17  )
18
19if(WIN32)
20  add_definitions(-DGTEST_OS_WINDOWS=1)
21endif()
22
23if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
24  add_definitions("-Wno-variadic-macros")
25endif()
26
27set(LLVM_REQUIRES_RTTI 1)
28add_definitions( -DGTEST_HAS_RTTI=0 )
29
30# Visual Studio 2012 only supports up to 8 template parameters in
31# std::tr1::tuple by default, but gtest requires 10
32if(MSVC AND MSVC_VERSION EQUAL 1700)
33  add_definitions(-D_VARIADIC_MAX=10)
34endif ()
35
36add_llvm_library(gtest
37  googletest/gtest.cc
38  googletest/gtest-death-test.cc
39  googletest/gtest-filepath.cc
40  googletest/gtest-port.cc
41  googletest/gtest-printers.cc
42  googletest/gtest-test-part.cc
43  googletest/gtest-typed-test.cc
44  )
45
46add_llvm_library(gtest_main
47  UnitTestMain/TestMain.cpp
48  )
49