~ubuntu-branches/ubuntu/wily/orthanc-postgresql/wily

« back to all changes in this revision

Viewing changes to Resources/CMake/GoogleTestConfiguration.cmake

  • Committer: Package Import Robot
  • Author(s): Sebastien Jodogne, Sebastien Jodogne, Karsten Hilbert
  • Date: 2015-08-03 09:23:28 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150803092328-swn3mnpj0fz34v42
Tags: 1.2-1
[ Sebastien Jodogne ]
* New upstream version

[ Karsten Hilbert ]
* Enhancements for README.Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Orthanc - A Lightweight, RESTful DICOM Store
2
 
# Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
3
 
# Department, University Hospital of Liege, Belgium
4
 
#
5
 
# This program is free software: you can redistribute it and/or
6
 
# modify it under the terms of the GNU Affero General Public License
7
 
# as published by the Free Software Foundation, either version 3 of
8
 
# the License, or (at your option) any later version.
9
 
#
10
 
# This program is distributed in the hope that it will be useful, but
11
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
# Affero General Public License for more details.
14
 
15
 
# You should have received a copy of the GNU Affero General Public License
16
 
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
 
 
18
 
 
19
 
if (USE_GTEST_DEBIAN_SOURCE_PACKAGE)
20
 
  set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc)
21
 
  include_directories(/usr/src/gtest)
22
 
 
23
 
  if (NOT EXISTS /usr/include/gtest/gtest.h OR
24
 
      NOT EXISTS ${GTEST_SOURCES})
25
 
    message(FATAL_ERROR "Please install the libgtest-dev package")
26
 
  endif()
27
 
 
28
 
elseif (STATIC_BUILD OR NOT USE_SYSTEM_GOOGLE_TEST)
29
 
  set(GTEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/gtest-1.7.0)
30
 
  DownloadPackage(
31
 
    "2d6ec8ccdf5c46b05ba54a9fd1d130d7"
32
 
    "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/gtest-1.7.0.zip"
33
 
    "${GTEST_SOURCES_DIR}")
34
 
 
35
 
  include_directories(
36
 
    ${GTEST_SOURCES_DIR}/include
37
 
    ${GTEST_SOURCES_DIR}
38
 
    )
39
 
 
40
 
  set(GTEST_SOURCES
41
 
    ${GTEST_SOURCES_DIR}/src/gtest-all.cc
42
 
    )
43
 
 
44
 
  # https://code.google.com/p/googletest/issues/detail?id=412
45
 
  if (MSVC) # VS2012 does not support tuples correctly yet
46
 
    add_definitions(/D _VARIADIC_MAX=10)
47
 
  endif()
48
 
 
49
 
else()
50
 
  include(FindGTest)
51
 
  if (NOT GTEST_FOUND)
52
 
    message(FATAL_ERROR "Unable to find GoogleTest")
53
 
  endif()
54
 
 
55
 
  include_directories(${GTEST_INCLUDE_DIRS})
56
 
  link_libraries(${GTEST_LIBRARIES})
57
 
endif()