annotate Resources/CMake/GoogleTestConfiguration.cmake @ 2253:441352e7a9d1

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Jan 2017 14:16:46 +0100
parents 8b51b133bb8b
children 741bb76634d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
638
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
1 if (USE_GTEST_DEBIAN_SOURCE_PACKAGE)
2159
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
2 find_path(GTEST_DEBIAN_SOURCES_DIR
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
3 NAMES src/gtest-all.cc
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
4 PATHS
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
5 /usr/src/gtest
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
6 /usr/src/googletest/googletest
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
7 PATH_SUFFIXES src
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
8 )
157
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
9
2159
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
10 find_path(GTEST_DEBIAN_INCLUDE_DIR
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
11 NAMES gtest.h
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
12 PATHS
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
13 /usr/include/gtest
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
14 )
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
15
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
16 message("Path to the Debian Google Test sources: ${GTEST_DEBIAN_SOURCES_DIR}")
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
17 message("Path to the Debian Google Test includes: ${GTEST_DEBIAN_INCLUDE_DIR}")
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
18
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
19 set(GTEST_SOURCES ${GTEST_DEBIAN_SOURCES_DIR}/src/gtest-all.cc)
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
20 include_directories(${GTEST_DEBIAN_SOURCES_DIR})
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
21
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
22 if (NOT EXISTS ${GTEST_SOURCES} OR
cfaf2bea096e fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2113
diff changeset
23 NOT EXISTS ${GTEST_DEBIAN_INCLUDE_DIR}/gtest.h)
157
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
24 message(FATAL_ERROR "Please install the libgtest-dev package")
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
25 endif()
134
bdc60d16cc98 improved cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
26
634
d775a3cb5a06 refactoring of CMake scripts
jodogne
parents: 553
diff changeset
27 elseif (STATIC_BUILD OR NOT USE_SYSTEM_GOOGLE_TEST)
1092
88fcf73fbe39 Upgrade to Google Test 1.7.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
28 set(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.7.0)
2186
8b51b133bb8b move of third party downloads to the main server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2159
diff changeset
29 set(GTEST_URL "http://www.orthanc-server.com/downloads/third-party/gtest-1.7.0.zip")
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1092
diff changeset
30 set(GTEST_MD5 "2d6ec8ccdf5c46b05ba54a9fd1d130d7")
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1092
diff changeset
31
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1092
diff changeset
32 DownloadPackage(${GTEST_MD5} ${GTEST_URL} "${GTEST_SOURCES_DIR}")
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 include_directories(
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ${GTEST_SOURCES_DIR}/include
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ${GTEST_SOURCES_DIR}
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 )
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 set(GTEST_SOURCES
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ${GTEST_SOURCES_DIR}/src/gtest-all.cc
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 )
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
1061
4b4ab35c04f5 fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 638
diff changeset
43 # https://code.google.com/p/googletest/issues/detail?id=412
4b4ab35c04f5 fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 638
diff changeset
44 if (MSVC) # VS2012 does not support tuples correctly yet
4b4ab35c04f5 fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 638
diff changeset
45 add_definitions(/D _VARIADIC_MAX=10)
4b4ab35c04f5 fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 638
diff changeset
46 endif()
4b4ab35c04f5 fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 638
diff changeset
47
2113
0108ac01fc8e added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1537
diff changeset
48 source_group(ThirdParty\\GoogleTest REGULAR_EXPRESSION ${GTEST_SOURCES_DIR}/.*)
0108ac01fc8e added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1537
diff changeset
49
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 else()
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 include(FindGTest)
157
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
52 if (NOT GTEST_FOUND)
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
53 message(FATAL_ERROR "Unable to find GoogleTest")
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
54 endif()
a63fb54819d7 gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
55
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 include_directories(${GTEST_INCLUDE_DIRS})
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 link_libraries(${GTEST_LIBRARIES})
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 endif()