Description: Fix to use the new version of Google Test in Debian
Author: Sebastien Jodogne <s.jodogne@gmail.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: Orthanc-1.1.0/Resources/CMake/GoogleTestConfiguration.cmake
===================================================================
--- Orthanc-1.1.0.orig/Resources/CMake/GoogleTestConfiguration.cmake
+++ Orthanc-1.1.0/Resources/CMake/GoogleTestConfiguration.cmake
@@ -1,9 +1,26 @@
 if (USE_GTEST_DEBIAN_SOURCE_PACKAGE)
-  set(GTEST_SOURCES /usr/src/gtest/src/gtest-all.cc)
-  include_directories(/usr/src/gtest)
+  find_path(GTEST_DEBIAN_SOURCES_DIR
+    NAMES src/gtest-all.cc
+    PATHS
+    /usr/src/gtest
+    /usr/src/googletest/googletest
+    PATH_SUFFIXES src
+    )
+
+  find_path(GTEST_DEBIAN_INCLUDE_DIR
+    NAMES gtest.h
+    PATHS
+    /usr/include/gtest
+    )
 
-  if (NOT EXISTS /usr/include/gtest/gtest.h OR
-      NOT EXISTS ${GTEST_SOURCES})
+  message("Path to the Debian Google Test sources: ${GTEST_DEBIAN_SOURCES_DIR}")
+  message("Path to the Debian Google Test includes: ${GTEST_DEBIAN_INCLUDE_DIR}")
+
+  set(GTEST_SOURCES ${GTEST_DEBIAN_SOURCES_DIR}/src/gtest-all.cc)
+  include_directories(${GTEST_DEBIAN_SOURCES_DIR})
+
+  if (NOT EXISTS ${GTEST_SOURCES} OR
+      NOT EXISTS ${GTEST_DEBIAN_INCLUDE_DIR}/gtest.h)
     message(FATAL_ERROR "Please install the libgtest-dev package")
   endif()
 
@@ -28,6 +45,8 @@ elseif (STATIC_BUILD OR NOT USE_SYSTEM_G
     add_definitions(/D _VARIADIC_MAX=10)
   endif()
 
+  source_group(ThirdParty\\GoogleTest REGULAR_EXPRESSION ${GTEST_SOURCES_DIR}/.*)
+
 else()
   include(FindGTest)
   if (NOT GTEST_FOUND)
