Mercurial > hg > orthanc
annotate Resources/CMake/GoogleTestConfiguration.cmake @ 2120:4b02ec79728a
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 11:19:19 +0100 |
parents | 0108ac01fc8e |
children | cfaf2bea096e |
rev | line source |
---|---|
638 | 1 if (USE_GTEST_DEBIAN_SOURCE_PACKAGE) |
157
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
2 set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc) |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
3 include_directories(/usr/src/gtest) |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
4 |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
5 if (NOT EXISTS /usr/include/gtest/gtest.h OR |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
6 NOT EXISTS ${GTEST_SOURCES}) |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
7 message(FATAL_ERROR "Please install the libgtest-dev package") |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
8 endif() |
134 | 9 |
634 | 10 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
|
11 set(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.7.0) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1092
diff
changeset
|
12 set(GTEST_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/gtest-1.7.0.zip") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1092
diff
changeset
|
13 set(GTEST_MD5 "2d6ec8ccdf5c46b05ba54a9fd1d130d7") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1092
diff
changeset
|
14 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1092
diff
changeset
|
15 DownloadPackage(${GTEST_MD5} ${GTEST_URL} "${GTEST_SOURCES_DIR}") |
0 | 16 |
17 include_directories( | |
18 ${GTEST_SOURCES_DIR}/include | |
19 ${GTEST_SOURCES_DIR} | |
20 ) | |
21 | |
22 set(GTEST_SOURCES | |
23 ${GTEST_SOURCES_DIR}/src/gtest-all.cc | |
24 ) | |
25 | |
1061
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
26 # 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
|
27 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
|
28 add_definitions(/D _VARIADIC_MAX=10) |
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
29 endif() |
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
30 |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
31 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
|
32 |
0 | 33 else() |
34 include(FindGTest) | |
157
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
35 if (NOT GTEST_FOUND) |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
36 message(FATAL_ERROR "Unable to find GoogleTest") |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
37 endif() |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
38 |
0 | 39 include_directories(${GTEST_INCLUDE_DIRS}) |
40 link_libraries(${GTEST_LIBRARIES}) | |
41 endif() |