From 4080af49ae67cb40c8be3d7c7c626e38b610a128 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Tue, 12 Sep 2017 14:47:20 +0200
Subject: [PATCH] add a tests/ folder to be able to test morse find package

---
 modules/find/tests/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 modules/find/tests/CMakeLists.txt

diff --git a/modules/find/tests/CMakeLists.txt b/modules/find/tests/CMakeLists.txt
new file mode 100644
index 0000000..ee6aba5
--- /dev/null
+++ b/modules/find/tests/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required(VERSION 2.8)
+project(TEST_MORSE_CMAKE_MODULES_FIND Fortran C CXX)
+
+# location of Find package modules
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../")
+
+# main variable: control the list of libraries to find thanks to find_package
+# pay attention that package names must be given with capital letters
+set(PACKAGES_TO_FIND "" CACHE STRING "List of packages to find, ex: BLAS;STARPU;PASTIX")
+
+# if the list is empty: simple test with hwloc
+if (NOT PACKAGES_TO_FIND)
+  list(APPEND PACKAGES_TO_FIND "HWLOC")
+endif()
+
+foreach(_library ${PACKAGES_TO_FIND})
+
+  find_package(${_library})
+  if (${_library}_FOUND)
+    if (${_library}_LIBRARIES)
+      message(STATUS "${_library}_LIBRARIES found: ${${_library}_LIBRARIES}")
+    else()
+      message(ERROR "${_library}_LIBRARIES not found: ${${_library}_LIBRARIES}")
+    endif()
+    if (${_library}_LIBRARY_DIRS)
+      message(STATUS "${_library}_LIBRARY_DIRS found: ${${_library}_LIBRARY_DIRS}")
+    else()
+      message(WARNING "${_library}_LIBRARY_DIRS not found: ${${_library}_LIBRARY_DIRS}")
+    endif()
+    if (${_library}_INCLUDE_DIRS)
+      message(STATUS "${_library}_INCLUDE_DIRS found: ${${_library}_INCLUDE_DIRS}")
+    else()
+      message(WARNING "${_library}_INCLUDE_DIRS not found: ${${_library}_INCLUDE_DIRS}")
+    endif()
+  else()
+    message(FATAL_ERROR "${_library} NOT FOUND !!")
+  endif()
+
+endforeach()
+
+###
+### END CMakeLists.txt
+###
-- 
GitLab