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