From ddb55cb534faa5c65deef405bcfbc091b66fbb53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pascal=20Have=CC=81?= <hpwxf@haveneer.com>
Date: Sat, 6 Jul 2019 22:29:47 +0200
Subject: [PATCH] Use Catch2 target given by Catch2 cmake configuration

instead of using manually defined target
and then header path requires catch2/ prefix (ie "catch2/catch.hpp")
---
 CMakeLists.txt               | 2 --
 tests/CMakeLists.txt         | 3 ---
 tests/mpi_test_Messenger.cpp | 2 +-
 tests/mpi_test_main.cpp      | 2 +-
 tests/test_Array.cpp         | 2 +-
 tests/test_ArrayUtils.cpp    | 2 +-
 tests/test_ItemType.cpp      | 2 +-
 tests/test_PugsAssert.cpp    | 2 +-
 tests/test_RevisionInfo.cpp  | 2 +-
 tests/test_TinyMatrix.cpp    | 2 +-
 tests/test_TinyVector.cpp    | 2 +-
 tests/test_main.cpp          | 2 +-
 12 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50864fccb..352b13ed8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -211,8 +211,6 @@ include_directories(${PUGS_BINARY_DIR}/src/utils)
 # Pugs tests
 
 set(CATCH_MODULE_PATH "${PUGS_SOURCE_DIR}/packages/Catch2")
-set(CATCH_INCLUDE_PATH "${CATCH_MODULE_PATH}/single_include/catch2")
-
 include("${CATCH_MODULE_PATH}/contrib/ParseAndAddCatchTests.cmake")
 add_subdirectory("${CATCH_MODULE_PATH}")
 
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4eef6c187..dad75a120 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,3 @@
-include_directories("${CATCH_INCLUDE_PATH}")
 include_directories("${PUGS_BINARY_DIR}/src/utils")
 set(EXECUTABLE_OUTPUT_PATH ${PUGS_BINARY_DIR})
 
@@ -18,8 +17,6 @@ add_executable (mpi_unit_tests
   mpi_test_Messenger.cpp
   )
 
-target_include_directories(Catch2 INTERFACE ${CATCH_INCLUDE_DIR})
-
 target_link_libraries (unit_tests
   PugsUtils
   kokkos
diff --git a/tests/mpi_test_Messenger.cpp b/tests/mpi_test_Messenger.cpp
index 64dd89275..4d446ba65 100644
--- a/tests/mpi_test_Messenger.cpp
+++ b/tests/mpi_test_Messenger.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Array.hpp>
 #include <Messenger.hpp>
diff --git a/tests/mpi_test_main.cpp b/tests/mpi_test_main.cpp
index 43512cc5e..541d48a37 100644
--- a/tests/mpi_test_main.cpp
+++ b/tests/mpi_test_main.cpp
@@ -1,5 +1,5 @@
 #define CATCH_CONFIG_RUNNER
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Kokkos_Core.hpp>
 #include <Messenger.hpp>
diff --git a/tests/test_Array.cpp b/tests/test_Array.cpp
index 54610b6e9..e9f7238ef 100644
--- a/tests/test_Array.cpp
+++ b/tests/test_Array.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Array.hpp>
 #include <PugsAssert.hpp>
diff --git a/tests/test_ArrayUtils.cpp b/tests/test_ArrayUtils.cpp
index 8528d724e..0f54e23a0 100644
--- a/tests/test_ArrayUtils.cpp
+++ b/tests/test_ArrayUtils.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Array.hpp>
 #include <ArrayUtils.hpp>
diff --git a/tests/test_ItemType.cpp b/tests/test_ItemType.cpp
index 9b2813dff..8560f8790 100644
--- a/tests/test_ItemType.cpp
+++ b/tests/test_ItemType.cpp
@@ -1,5 +1,5 @@
 #include <PugsMacros.hpp>
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <ItemType.hpp>
 
diff --git a/tests/test_PugsAssert.cpp b/tests/test_PugsAssert.cpp
index afa6e6d4b..ccbc47203 100644
--- a/tests/test_PugsAssert.cpp
+++ b/tests/test_PugsAssert.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <PugsAssert.hpp>
 #include <string>
diff --git a/tests/test_RevisionInfo.cpp b/tests/test_RevisionInfo.cpp
index fafde85b4..8bf2cf49f 100644
--- a/tests/test_RevisionInfo.cpp
+++ b/tests/test_RevisionInfo.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <RevisionInfo.hpp>
 
diff --git a/tests/test_TinyMatrix.cpp b/tests/test_TinyMatrix.cpp
index 9ae46f62d..fe45b86e0 100644
--- a/tests/test_TinyMatrix.cpp
+++ b/tests/test_TinyMatrix.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Kokkos_Core.hpp>
 #include <PugsAssert.hpp>
diff --git a/tests/test_TinyVector.cpp b/tests/test_TinyVector.cpp
index 1988bb6bb..79ffb373e 100644
--- a/tests/test_TinyVector.cpp
+++ b/tests/test_TinyVector.cpp
@@ -1,4 +1,4 @@
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <PugsAssert.hpp>
 #include <TinyVector.hpp>
diff --git a/tests/test_main.cpp b/tests/test_main.cpp
index 050995133..e0ed7b5fe 100644
--- a/tests/test_main.cpp
+++ b/tests/test_main.cpp
@@ -1,5 +1,5 @@
 #define CATCH_CONFIG_RUNNER
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <Kokkos_Core.hpp>
 
-- 
GitLab